A set of patches has just landed on main, which convert our ESLint
configuration to use newer ESLint's "flat" configuration format.
There are a few things to be aware of:
* If you have previously used node in one of the following
directories, you'll need to either remove the node_modules
sub-directory from the relevant directories, or run the appropriate
command to re-install them (e.g. mach npm ci). You'll definitely
need to do this if you see the error *Global
"AudioWorkletGlobalScope " has leading or trailing whitespace* when
running ESLint.
o |browser/components/asrouter|
o |browser/components/aboutwelcome|
o |browser/extensions/newtab|
o |tools/ts|
* If you've updated the branch with your editor open, you may need to
restart your editor to fully pick up the changes.
* *Environments have changed*.
o |/* eslint-env foo */| will no longer work.
o You will need to either use aknown file naming which represents
the file (e.g. |*.worker.mjs| for a worker), or update the list
in |eslint-file-globals.config.mjs|.
o Please read the note at the top of |eslint-rollouts.config.mjs|
for the details about options.
* *Ignore File has moved locations*
o The top-level |.eslintignore| file has now moved to
|eslint-ignores.config.mjs|
* Due to the way the flat configuration works, all sub-configurations
must now be included in the top-level configuration, via
|eslint-subdirs.config.mjs|. However, please do not add to this file
without talking to the frontend code reviewers group
<https://firefox-source-docs.mozilla.org/mots/#javascript-usage-tools-and-style>
first. We generally want rules to be consistent across the whole
tree, and there may be other ways of achieving what you need.
If you have any general questions, please ask in the #lint:mozilla.org
channel (aka Lint and Formatting) on Matrix.
The flat configuration provides a deterministic setup, and paths the way
for upgrading to ESLint v9. In turn, this will allow us to pick up some
new features in ESLint, and also tidy up a lot of the older
configuration code.
Mark.
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/37edcf7c-d66c-456d-a25b-fb4cf674f39d%40mozilla.com.