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

ESLint doesn't work with flat config #78

Open
TiroZit opened this issue Oct 11, 2023 · 3 comments · May be fixed by #82
Open

ESLint doesn't work with flat config #78

TiroZit opened this issue Oct 11, 2023 · 3 comments · May be fixed by #82

Comments

@TiroZit
Copy link

TiroZit commented Oct 11, 2023

Describe the bug

ESLint introduced a new configuration format eslint.config.js (flat config). With the new format, an error is thrown when starting the application:

node:internal/event_target:1012
  process.nextTick(() => { throw err; });
                           ^
Error: No ESLint configuration found in \src\stories\_utils\docs.
    at CascadingConfigArrayFactory._finalizeConfigArray (\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3977:19)
    at CascadingConfigArrayFactory.getConfigArrayForFile (\node_modules\@eslint\eslintrc\dist\eslintrc.cjs:3768:21)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:473:52)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:495:33)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:495:33)
    at _iterateFilesRecursive.next (<anonymous>)
    at FileEnumerator._iterateFilesRecursive (\node_modules\eslint\lib\cli-engine\file-enumerator.js:495:33)
    at _iterateFilesRecursive.next (<anonymous>)
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:300:10)
    at [kOnMessage] (node:internal/worker:311:37)
    at MessagePort.<anonymous> (node:internal/worker:212:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:737:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)
    at [kOnExit] (node:internal/worker:278:5)
    at Worker.<computed>.onexit (node:internal/worker:209:20) {
  messageTemplate: 'no-config-found',
  messageData: {
    directoryPath: 'src\\stories\\_utils\\docs'
  }

Running ESLint directly via CLI works with the new config. The checker plugin worked properly before migrating to the new ESLint config.

Expected behavior

ESLint should run without an error and the eslint.config.js file should be used.

The ESLint class used by this plugin doesn't support the new flat config. For the flat config the FlatESLint class must be used which is only exported via eslint/use-at-your-own-risk entrypoint: https://eslint.org/blog/2022/08/new-config-system-part-3/#using-flat-config-with-the-eslint-class

@mitchwd
Copy link

mitchwd commented Oct 20, 2023

This is a duplicate of #55, but looks like neither has had a response from the repo owner. 😕

@tthornton3-chwy tthornton3-chwy linked a pull request Nov 17, 2023 that will close this issue
@tthornton3-chwy
Copy link

Added here as well -- #82 should close this issue :) We just gotta get the repo owner to either merge some of these PRs in, or give some other people write access to the project @gxmari007 I understand things get busy, i've been there too! Let the community help support the wonderful tool that you helped create <3 I volunteer to merge PRs in, and if I become too busy as well I would hand over the reigns to someone else.

@mnai01
Copy link

mnai01 commented Mar 15, 2024

This newer plugin works with flat files. Doesn't seem like #82 is going to be merged anytime soon.
@nabla/vite-plugin-eslint

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

Successfully merging a pull request may close this issue.

4 participants