Hey folks,

The tree has been reformatted[0] using Prettier, and moving forwards we will 
enforce the new JS coding style across the entire codebase. Central, inbound 
and autoland will reopen shortly.


Rebasing

If you have any pending patches touching JS code, you’ll likely require to 
rebase. To make this process as seamless as possible, please run `./mach 
bootstrap` and say yes to everything.

If you run into any trouble, make sure you read the wiki[1]. The parent 
changeset of the reformat (b7030ce607ec) has been tagged[2] as 
`PRE_TREEWIDE_PRETTIER_FORMAT`. We also recommend first rebasing to this parent 
changeset if your patches are old.


Developing

We recommend setting up your editor to format on save, or alternatively using a 
commit hook.

Check out the guides on setting up your development environment here: 
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_JS_Code_With_Prettier_and_eslint
 
<https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_JS_Code_With_Prettier_and_eslint>
 


Configuring

Code quality configurations for eslint are entirely determined by the options 
defined in .eslintrc.js. However, coding style configurations are largely 
predetermined within Prettier itself, and we only specify a minimal set of 
options in .prettierrc.

There may be technical reasons to get Prettier to ignore a block of code (e.g. 
JS parser tests). For that, use  `/* eslint-disable prettier/prettier */` or 
`// prettier-ignore`. But these ignores are for technical reasons only, not for 
stylistic preference reasons. See the wiki for more info[3].


Victor

[0] 
https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=041abaa4aa85f5a776e2a6d6fa3e6874d007faad
 
<https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=041abaa4aa85f5a776e2a6d6fa3e6874d007faad>
 
[1] 
https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=8484541d66d7f30289f295c2f72c79ac660b6560
 
<https://treeherder.mozilla.org/#/jobs?repo=mozilla-central&revision=8484541d66d7f30289f295c2f72c79ac660b6560>
  
[2] 
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_JS_Code_With_Prettier_and_eslint#Merging_formatted_and_unformatted_code
 
<https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_JS_Code_With_Prettier_and_eslint#Merging_formatted_and_unformatted_code>
  
[3] 
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_JS_Code_With_Prettier_and_eslint#Configuration
 
<https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Coding_Style/Formatting_JS_Code_With_Prettier_and_eslint#Configuration>
  
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to