Bug: flat configs are processing ignored directories and applying rules that were scoped to other directories #18372
Labels
bug
ESLint is working incorrectly
needs info
Not enough information has been provided to triage this issue
repro:needed
Environment
npx eslint --env-info
does not function properly with flat configNode version: v18.20.2 (N/A)
npm version: v10.5.0 (N/A)
Local ESLint version: v8.57.0
Global ESLint version: Not found
Operating System: darwin 22.6.0
Bun: 1.1.2
Pnpm: 8.15.6
What parser are you using?
What did you do?
Note: I'm using flat config which can't be copy pasted due to their size
Configuration
What did you expect to happen?
all lint rules pass as expected
What actually happened?
lint rules failed for files within ignore in a manner that suggests rules but not plugins were applied globally
Note: all files parsed by the typescript rules passed successfully. Those rules specify exactly which files to match in the config object under
files
which in this case is scoped to the directory./src
. So this suggests that rules were hoisted out of a config object and applied both to files that they were not intended to apply to and without the plugin they depend upon.globalIgnores(),
is a list of files and directories to always ignore using the global overrides pattern:Note: the actual list is much longer, but I've shortend it to just what we care about here. Also note how just in case I've tried every variant of directory glob just in case eslint shifted away from
dist
working as expected. No variation worked.Debugging with
bun run eslint --print-config ./dist/test-support/index.js
leads to an interesting observation:Based on the ignores this file shouldn't be in the system, but what we see is that default language options have been applied. Note though, no rules ;)
Link to Minimal Reproducible Example
N/A
Participation
Additional comments
Note using the new rules debugger is not possible.
eslint --inspect-config
errors as--inspect-config
is not valid.npx @eslint/config-inspector
fails because it cannot find eslint since this is a project that enforces strict node_modules vs dangerously hoisting them like the tool depends upon.The text was updated successfully, but these errors were encountered: