-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Docs: Clarify that -c configs merge with .eslintrc.*
(fixes #9535)
#9847
Conversation
Users must use --no-eslintrc to prevent `.eslintrc.*` files from being used
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, thanks!
@@ -45,37 +47,44 @@ Specifying rules and plugins: | |||
|
|||
Fixing problems: | |||
--fix Automatically fix problems | |||
--fix-dry-run Automatically fix problems without saving the changes to the file system | |||
--fix-dry-run Automatically fix problems without saving the | |||
changes to the file system |
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.
Were these whitespace changes intentional?
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.
No, I think they happened due to me running --help
on a narrow terminal window. I can certainly fix these for our docs, if desired, since web browsers could horizontally scroll if needed. Thoughts?
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.
I figured it out. Last time I ran --help
and piped directly into a file, so no TTY and no max-width TTY display. This time, I was using the Node runtime in a TTY. I'll push another commit to fix this.
Users must use --no-eslintrc to prevent
.eslintrc.*
files from being usedWhat is the purpose of this pull request? (put an "X" next to item)
[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
See #9535.
What changes did you make? (Give an overview)
--no-eslintrc
and-c
options in CLI help-c
will merge with.eslintrc.*
if--no-eslintrc
is not specified, in the following places:--help
output sample as well as in the more detailed description for-c
)Is there anything you'd like reviewers to focus on?
I tried to keep the notes as brief as possible while (hopefully) getting the point across. Please let me know if they can be improved.
I intentionally made some changes to suggest that ESLint conventionally favors
.eslintrc.*
files, to help emphasize that the.eslintrc.*
logic needs to be turned off for single configuration file cases. As it is now, it's easy for a user to see-c
first on the list of CLI options and assume that's all they need to do to configure ESLint with their one file. In my view,-c
is actually a supplemental configuration option, which may or may not be combined with the primary.eslintrc.*
configuration files by using or not using--no-eslintrc
. Let me know if this doesn't reflect how we see configuration files in this project.