Closed Bug 1601681 Opened 4 years ago Closed 4 years ago

Prettier formatting should specify Unix line endings

Categories

(Developer Infrastructure :: Lint and Formatting, defect, P2)

defect

Tracking

(firefox-esr68 unaffected, firefox71 wontfix, firefox72 wontfix, firefox73 fixed)

RESOLVED FIXED
mozilla73
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.

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.

Sure, it was more a FYI :)

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

This was accidentally regressed to match existing line endings in the switch to prettier.

Depends on D55990

Bugbug thinks this bug is a defect, but please change it back in case of error.

Type: task → defect
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
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla73
Has Regression Range: --- → yes
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: