Closed Bug 1808941 Opened 2 years ago Closed 2 years ago

Improve and simplify newtab's ESLint configuration

Categories

(Firefox :: New Tab Page, task)

task

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

I'd like to tidy up newtab's ESLint setup a bit:

  • Only specify the browser/mochitest configurations and environments (node) where they should be used (the test directories).
  • Remove rule definitions that are turning off rules but have no effect as the rule is already off.
  • Remove/replace some redundant rules.

These rules are not enabled by default in either the ESLint or Mozilla recommended configs. Some of the rules are deprecated.

Depends on D166195

The 'strict' rule is only enabled for mjs files, as per Mozilla's recommended config.

Depends on D166196

no-catch-shadow has been replaced by no-shadow, which is already enabled.
no-label-var is unnecessary, as no-label is enabled everywhere already.
no-negated-in-lhs has been replaced by no-unsafe-negation which is an ESLint recommended rule and is enabled everywhere.

Depends on D166197

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/a20a5cde0fe5 In newtab's ESLint configuration, only specify test environments where they are actually used to get the correct globals and rules. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/44c2c13bd7d9 In newtab's ESLint setup, only specify node environment where it is actually used. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/9adc7f9ee3c6 Remove ESLint rules from newtab's ESLint setup where the rule is specified as turned off but it has no effects. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/eee0bb5a4c96 Enable ESLint rules no-restricted-globals and strict for newtab. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/3df3536eabbb Remove unnecessary/redundant rule specifications from newtab's ESLint configuration. r=aminomancer

Backed out 5 changesets (Bug 1808941) for causing newtab failures.
Backout link
Push with failures <--> newtab
Failure Log

Flags: needinfo?(standard8)

Oh, two files touched the activity stream bundle which ends up with a little bit of whitespace change. Fixed & will re-land.

Flags: needinfo?(standard8)
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b7e7f340c9fa In newtab's ESLint configuration, only specify test environments where they are actually used to get the correct globals and rules. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/17754c33a573 In newtab's ESLint setup, only specify node environment where it is actually used. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/c3a091f9da07 Remove ESLint rules from newtab's ESLint setup where the rule is specified as turned off but it has no effects. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/6497b86debb2 Enable ESLint rules no-restricted-globals and strict for newtab. r=aminomancer https://hg.mozilla.org/integration/autoland/rev/eb074e92561d Remove unnecessary/redundant rule specifications from newtab's ESLint configuration. r=aminomancer

Thanks!

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: