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
Fix: Remove default .js from --ext CLI option #13176
Conversation
Does this mean that without an overrides including .js files, and without an ext option, eslint won’t lint js by default? |
In the absence of an |
Thanks for clarifying :-) sounds great to me. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
I think that Fix:
is better because it may confuse people if a follow-up appears as "Breaking:" in the 7.0.0 changelog.
PR #12677, `Breaking: lint overrides files`, removed the default `.js` value from the default CLIEngine options. However, it did not remove the same default value from the `--ext` option parsed by Optionator. Because of this, when running `eslint .` without the `--ext` option, Optionator would insert a default `--ext .js` value that would be passed on to the CLIEngine. ESLint only lints `overrides` files if the `--ext` CLI option is not passed, so the default `--ext .js` option prevented ESLint from ever reaching the `overrides` file path checking flow.
Thanks for contributing! |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[x] Bug fix (template)
Tell us about your environment
7.0.0-alpha.3
13.11.0
6.13.7
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
Because I included
md
andjsx
overrides
in.eslintrc.js
, ESLint should have seen the syntax error in the Markdown file's JSX code block.What actually happened? Please include the actual, raw output from ESLint.
No errors were reported.
What changes did you make? (Give an overview)
PR #12677,
Breaking: lint overrides files
, removed the default.js
value from the default CLIEngine options. However, it did not remove the same default value from the--ext
option parsed by Optionator. Because of this, when runningeslint .
without the--ext
option, Optionator would insert a default--ext .js
value that would be passed on to the CLIEngine. ESLint only lintsoverrides
files if the--ext
CLI option is not passed, so the default--ext .js
option prevented ESLint from ever reaching theoverrides
file path checking flow.Is there anything you'd like reviewers to focus on?
Is this a
Fix:
or aBreaking:
? It's a bug fix because it enables behavior that was supposed to be working already, but it's also a breaking change because it removes a CLI option's default value. Since we're still in prereleases, I went withBreaking:
since it won't prevent us from doing anything.