Conversation
nathansobo
left a comment
There was a problem hiding this comment.
Looks great. In the follow-up PRs that you mention... if we're going to be doing a mass reformat, I wonder if it makes sense to just switch our linting rules to prettier's defaults at that time. The downside would be a bit more churn for the files that are already formatted with prettier+standard rules, but I imagine that PR would touch quite a few files anyway.
Sounds good to me! The two changes of the default prettier config would be:
|
d41945a to
4048b49
Compare
As a followup of @nathansobo's change, this PR changes the linting infra of Atom to use
eslintdirectly, instead ofstandard.This allows a full integration with
prettier, better support for new syntax features and many more rules that were not enforced before.In order to keep this PR small and reviewable, I've disabled the
prettier/prettierrule for now in theeslintconfig, plus some other rules that were causing many errors.So there are a couple of next steps to do after this PR:
1. Enforce
prettierrulesI've prepared everything so this can be done super easily after this PR by setting the
prettier/prettiereslint rule toerrorand then runscript/lint --fix.This will run
prettierthrough the whole codebase (more specifically the files covered byeslint) and reformat them so they follow theprettierconventions. This will basically change whitespace since theprettierconfiguration has similar style rules asstandardjs.Once this is done, the linter will fail whenever a file does not have the correct formatting dictated by prettier. This can be fixed by either running
prettierfrom an editor or by runningscript/lint --fix.Since enabling
prettierwill change a looot of files (I just tried it and it modified 9k files), if we're concerned about merge conflicts or other potential problems we can also enable it progressively on some folders first by adding aneslintoverride.2. Enable some disabled rules
This is not urgent, but I have disabled some newer eslint rules for now since they cause many errors that we can fix later.
Since these rules were not enforced before, that's not a big issue, but most of them seem to be fair rules that make code less prone to errors.
When to do the prettier reformatting?
Reformatting all files can be a bit disruptive in two situations:
I don't see 1. as a big problem, but 2. can be quite annoying when we can to cherry-pick things to the current beta version. In order to minimize this one, we should merge the
prettierreformatting PR just before rolling the railcars for a new release (so bothmasterand the latestreleasebranch will have the new code).