Closed Bug 1773472 Opened 2 years ago Closed 2 years ago

Enable eslint-plugin-import for mjs files

Categories

(Developer Infrastructure :: Lint and Formatting, task, P2)

Tracking

(firefox103 fixed)

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

eslint-plugin-import has some useful rules to ensure that import files, names and other items are valid.

We already have the module in-tree, though it isn't actually turned on anywhere afaict (newtab attempts include it, but doesn't actually use any rules from it - I'll file a separate bug for that later).

The first version of this that I'm attaching turns on a lot of rules that I think are relevant and useful. For now, we turn off the no-unresolved (i.e. the file can't be found) for system mjs files and for some directories which have their own package.json. These each have their own issues, which I'll file follow-up bugs for.

A few comments about particular things I've not turned on at this stage:

  • no-unused-modules
    • This does a separate parse of all mjs files in the tree, causing big performance lags and doesn't seem worth having it on all the time (at least yet, I think we should explore it in future, once we have more files transitioned across).
  • no-cycle
    • This is also an expensive rule. Like no-unused-modules, I think we could explore this later.
  • no-internal-modules
    • I think we probably break this quite extensively at the moment.
Blocks: 1773473
Blocks: 1773475

Depends on D148773

Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7e5b24990d99 Enable eslint-plugin-import for mjs files. r=Gijs
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
Blocks: 1774647
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: