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
Bug: Flat config doesn't allow uppercase severities #17570
Comments
Can reproduce 👍. |
The constructor option const { FlatESLint } = require('eslint/use-at-your-own-risk');
const eslint = new FlatESLint({
reportUnusedDisableDirectives: 'Error' // throws ESLintInvalidOptionsError
}); |
There is also a |
I intentionally did not want to support these in flat config. I was trying to be more strict where possible to clean up some of the weirdness in eslintrc. So, this part isn't a bug, but the "undefined" in the error message definitely is. My preference is to keep the severities in all places as case-sensitive. |
@mdjermanovic are you okay with closing this? |
I'd like to fix Looks like the consensus is that rule severities should be case-sensitive. I'm working on this now. |
Environment
Node version: v16.14.0
npm version: v8.3.1
Local ESLint version: v8.49.0
Global ESLint version:
Operating System: windows
What parser are you using?
Default (Espree)
What did you do?
Configuration
What did you expect to happen?
I'd expect uppercase severities to work.
eslintrc allows severities such as
"Error"
or"eRRoR"
.flat config validation aims to allow them too:
eslint/lib/config/flat-config-schema.js
Lines 181 to 189 in bd7a71f
What actually happened?
Link to Minimal Reproducible Example
https://stackblitz.com/edit/stackblitz-starters-arttsx?file=eslint.config.js
Participation
Additional comments
Validation works as intended, but
normalizeRuleOptions
, which is used while merging, returnsundefined
, and then the subsequent validation on the next merge fails. That's why the error message at the end saysYou passed 'undefined'
.The text was updated successfully, but these errors were encountered: