Prettier formatting should specify Unix line endings
Categories
(Developer Infrastructure :: Lint and Formatting, defect, P2)
Tracking
(firefox-esr68 unaffected, firefox71 wontfix, firefox72 wontfix, firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox71 | --- | wontfix |
firefox72 | --- | wontfix |
firefox73 | --- | fixed |
People
(Reporter: standard8, Assigned: standard8)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
Prior to Prettier we used to have the requirement for unix line endings in files controlled by ESLint:
"linebreak-style": ["error", "unix"],
With the switch to Prettier, we removed the configuration option as it conflicted with Prettier's control.
However, we didn't realise that Prettier defaults to automatic line-endings which means it will just make files consistent with itself.
We should set the endOfLine
option to lf
to restore the original intention. We've already got a few newish files in tree with Windows line endings.
Comment 1•4 years ago
|
||
We have a lint for this in mozlint:
https://firefox-source-docs.mozilla.org/tools/lint/linters/file-whitespace.html
I just realized that js isn't in the list :|
https://searchfox.org/mozilla-central/source/tools/lint/file-whitespace.yml
Assignee | ||
Comment 2•4 years ago
|
||
Nor are html etc...
I think we should just fix this in Prettier. Prettier has integrations into editors today, and so developers that are using the editor integrations will get notified earlier. Prettier will also be doing some checking regardless of what we do elsewhere, so I think just telling it to do the right thing shouldn't be costing us any more.
Comment 3•4 years ago
|
||
Sure, it was more a FYI :)
Assignee | ||
Comment 4•4 years ago
|
||
There's about 14 files here, so I think we can just go with just fixing this asap. Try push:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7893e153689740d8b7c08a03891820b4fbe8df90
Assignee | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
This was accidentally regressed to match existing line endings in the switch to prettier.
Depends on D55990
Comment 7•4 years ago
|
||
Updated•4 years ago
|
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cce89a164ecb Switch recently added files with Windows line endings to Unix. r=mossop https://hg.mozilla.org/integration/autoland/rev/b145da421419 Re-enable unix-line endings on ESLint controlled files. r=mossop
Comment 9•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cce89a164ecb
https://hg.mozilla.org/mozilla-central/rev/b145da421419
Updated•4 years ago
|
Updated•4 years ago
|
Updated•2 years ago
|
Description
•