PSA: Please use // prettier-ignore to disable Prettier formatting

2,189 views
Skip to first unread message

Mark Banner

unread,
Apr 3, 2023, 6:22:40 AM4/3/23
to firefox-dev list, dev-pl...@mozilla.org

If you are disabling Prettier's/ESLint formatting in JavaScript or HTML files please use:

// prettier-ignore

Rather than:

// eslint-disable-next-line prettier/prettier

This should only be used in a few situations, e.g. for when we have a constant array that is more readable when laid out as a table.

The ESLint FAQ has been updated with a section describing this.

If the code is generated, or from third parties, please add it to the appropriate files. This will prevent all linters from touching it.

The reason for this change is that I am currently working on separating out Prettier from ESLint, so that they are run as separate processes. As part of this, we need to transition to use Prettier's ignore syntax rather than the syntax for ESLint. I have replaced most of the instances in the tree of the old method, and will tidy up the remainder soon.

Mark.

Reply all
Reply to author
Forward
0 new messages