In Docs, "Configuration Based on Glob Patterns" should specify it's a v4.1 feature. Fails silently on earlier versions. #8793
Labels
archived due to age
This issue has been archived; please open a new issue for any further discussion
documentation
Relates to ESLint's documentation
enhancement
This change enhances an existing feature of ESLint
evaluating
The team will evaluate this issue to decide whether it meets the criteria for inclusion
Tell us about your environment
Problem:
I had a default configuration for my
**/*.js
files and I was trying to set linting rules differently for my**/*.test.js
files. Mostly, I wanted to usedescribe
,it
, and other global testing variables in my testing files. I was trying to avoid messages likeerror 'describe' is not defined no-undef
On the Configuring ESLint's "Configuration Based on Glob Patterns" section, I found out I could specify glob-based overrides, and so I specified my configuration to something like this.
eslintrc.js
What did you expect to happen?
I expected my
*.test.js
files to be linted differently. I expected to get rid of theerror 'describe' is not defined no-undef
message. Instead, it persisted. And I had no idea why. I spent a hour checking my globs and configuration before realizing that I was still on v3.19.0 and the glob-based overrides were only added 2 days ago, according to #3611.Once I upgraded to v4.1.0, the
overrides
syntax worked as normal.Two things that could help future developers avoid my mistake:
overrides
syntax is unavailable for them.The text was updated successfully, but these errors were encountered: