clean up .eslintrc to follow eslint-prettier-plugin config suggestions
Categories
(Firefox :: Messaging System, task, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox69 | --- | fixed |
People
(Reporter: dmosedale, Assigned: dmosedale)
References
(Blocks 1 open bug)
Details
(Keywords: github-merged)
Attachments
(1 file)
:vporof found issues with our .eslintrc for cleanup:
- the
plugin:prettier/recommended
configuration should come before other extnds, - you shouldn’t specify the
prettier
plugin in the plugins section if you use (1) - you shouldn’t specify the
prettier
configuration in the extends section if you use (1) - there’s several rules that were left around in the eslintrc file which are redundant
https://github.com/prettier/eslint-plugin-prettier has details.
Updated•5 years ago
|
Assignee | ||
Comment 1•5 years ago
|
||
(In reply to Dan Mosedale (:dmose, :dmosedale) from comment #0)
:vporof found issues with our .eslintrc for cleanup:
- the
plugin:prettier/recommended
configuration should come before other extnds,
So, point 2 in the eslint-plugin-prettier README sez:
Then you need to add plugin:prettier/recommended as the last extension in your .eslintrc.json
Which seems to be the opposite of what you're saying above, and what the AS .eslintrc does currently.
Confusingly, point 3 then shows "plugin:prettier/recommended" as the first extension.
One way to interpret these things to be non-conflicting is that "plugin:prettier/recommended" should be after all other plugins except the extra prettier exclusions.
So my inclination here is to use the above interpretation, I've Your thoughts?
- you shouldn’t specify the
prettier
plugin in the plugins section if you use (1)
Fixed.
- you shouldn’t specify the
prettier
configuration in the extends section if you use (1)
Fixed.
- there’s several rules that were left around in the eslintrc file which are redundant
So I've already disabled the ones flagged by eslint --print-config . | eslint-config-prettier-check
.
Are the "redundant" rules you're describing the ones starting at line 18 here:
https://github.com/prettier/eslint-config-prettier/blob/master/index.js#L18
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
@vporof: or did you just mean removing the ones shown here: https://phabricator.services.mozilla.com/differential/changeset/?ref=1123546
Comment 4•5 years ago
|
||
Yes, those are the redundant ones. I can handle them in a single shot with everything else when landing the mega-patch.
Comment 5•5 years ago
|
||
(In reply to Dan Mosedale (:dmose, :dmosedale) from comment #1)
(In reply to Dan Mosedale (:dmose, :dmosedale) from comment #0)
:vporof found issues with our .eslintrc for cleanup:
- the
plugin:prettier/recommended
configuration should come before other extnds,So, point 2 in the eslint-plugin-prettier README sez:
Then you need to add plugin:prettier/recommended as the last extension in your .eslintrc.json
Which seems to be the opposite of what you're saying above, and what the AS .eslintrc does currently.
Confusingly, point 3 then shows "plugin:prettier/recommended" as the first extension.
One way to interpret these things to be non-conflicting is that "plugin:prettier/recommended" should be after all other plugins except the extra prettier exclusions.
So my inclination here is to use the above interpretation, I've Your thoughts?
Yes, that's what I meant but I should've been more specific. The "plugin:prettier/recommended" entry should be after all other extends, but before other prettier-related extends such as "prettier/flowtype".
Assignee | ||
Comment 6•5 years ago
|
||
I'm going to do the redundant rules now so that we have less backporting work to do.
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 7•5 years ago
|
||
Description
•