Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Commandline option args ignored when using useFlatConfig=true #402

Open
2 tasks done
kamranasad7 opened this issue Sep 12, 2024 · 3 comments
Open
2 tasks done

Commandline option args ignored when using useFlatConfig=true #402

kamranasad7 opened this issue Sep 12, 2024 · 3 comments

Comments

@kamranasad7
Copy link

Describe the bug

When using flat eslint config for eslint checker, command line arguments doesn't work. Im using --ignore-pattern "src/foo/bar" as option in lint command and it completely ignores it and probably other options too.

Reproduction

  1. Integrate eslint in project using flat config.
  2. Setup eslint checker and pass --ignore-pattern or any other option in lint command of eslint checker.

Expected behavior

The eslint checker should read eslint cli arguments and pass it to eslint object. But it is observed that cli option arguments are ignored when using flat config.

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
    Memory: 2.50 GB / 15.75 GB
  Binaries:
    Node: 20.13.1 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.10.0 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    vite-plugin-checker: ^0.8.0 => 0.8.0

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@lpillonel
Copy link

I probably have a similar issue; it seems the "--cache" option is ignored as well (also using the flat config & eslint 9)

@AlexKrupko
Copy link

I'm facing the same issue. After a little investigation, I found that no command line options are passed to ESLint when we have useFlatConfig: true
/src/checkers/eslint/main.ts#L70-L78

I've fixed it temporarily in my project by adding the required options and creating a patch with patch-package. But it'd nice to have it fixed in the next releases.

eslint = new FlatESLint({
    cwd: root,
    cache: eslintOptions.cache,
    cacheLocation: eslintOptions.cacheLocation,
    cacheStrategy: eslintOptions.cacheStrategy,
});

@stvoidit
Copy link

In fact, this is a very terrible omission. It becomes extremely difficult to work on very large projects without this option.
Please take this as a high priority.
We recently found this plugin and are now using it as a default dependency in development - it is extremely useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants