Closed Bug 1561335 Opened 5 years ago Closed 5 years ago

clean up .eslintrc to follow eslint-prettier-plugin config suggestions

Categories

(Firefox :: Messaging System, task, P1)

task

Tracking

()

RESOLVED FIXED
Firefox 69
Iteration:
69.4 - Jun 24 - Jul 7
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:

  1. the plugin:prettier/recommended configuration should come before other extnds,
  2. you shouldn’t specify the prettier plugin in the plugins section if you use (1)
  3. you shouldn’t specify the prettier configuration in the extends section if you use (1)
  4. there’s several rules that were left around in the eslintrc file which are redundant

https://github.com/prettier/eslint-plugin-prettier has details.

Component: Activity Streams: Newtab → Messaging System

(In reply to Dan Mosedale (:dmose, :dmosedale) from comment #0)

:vporof found issues with our .eslintrc for cleanup:

  1. 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?

  1. you shouldn’t specify the prettier plugin in the plugins section if you use (1)

Fixed.

  1. you shouldn’t specify the prettier configuration in the extends section if you use (1)

Fixed.

  1. 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

Flags: needinfo?(vporof)

@vporof: or did you just mean removing the ones shown here: https://phabricator.services.mozilla.com/differential/changeset/?ref=1123546

Yes, those are the redundant ones. I can handle them in a single shot with everything else when landing the mega-patch.

(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:

  1. 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".

Flags: needinfo?(vporof)

I'm going to do the redundant rules now so that we have less backporting work to do.

Keywords: github-merged
Blocks: 1562320
Type: defect → task
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 69
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: