PSA: Prettier/ESLint set-up changed

14 views
Skip to first unread message

Mark Banner

unread,
Apr 18, 2023, 5:37:45 AM4/18/23
to firefox-dev list, dev-pl...@mozilla.org

A change to our Prettier/ESLint setup has just landed on mozilla-central:

  • Formatting issues are no longer directly raised by ESLint.
    • Formatting issues will not be raised by your editor with the default ESLint / Prettier plug-ins.
    • Enable save-on-format with Prettier in your favourite editor (more info below).
  • ./mach lint -l eslint and ./mach eslint will still work the same (as well as the --fix options).
    • They now run ESLint followed by prettier.
  • Phabricator & CI will still operate the same, but only state that the file needs formatting by Prettier, rather than the specific formatting errors.

Editor Configuration

It is highly recommended to enable automatic formatting when saving files. Most editors have options or plug-ins where you can enable Prettier & ESLint integrations.

For VS Code, we have updated ./mach ide vscode to automatically set the format on save options for Prettier. This assumes the recommended Prettier extension is installed.

./mach ide vscode will also now work for artifact builds.

There is more documentation about the VS Code setup in the contributing guide on Firefox source docs (it may take a few hours for the latest update to generate).

Questions?

Any questions, please visit #lint:mozilla.org on Matrix.

Mark

Reply all
Reply to author
Forward
0 new messages