Closed
Bug 1251003
Opened 9 years ago
Closed 8 years ago
Potentially rename deprecated .eslintrc files
Categories
(Developer Infrastructure :: Lint and Formatting, defect)
Developer Infrastructure
Lint and Formatting
Tracking
(firefox52 fixed)
RESOLVED
FIXED
mozilla52
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: Cykesiopka, Assigned: standard8)
References
Details
Attachments
(1 file)
According to http://eslint.org/docs/user-guide/configuring, .eslintrc files are deprecated in favour of .eslintrc.json, .eslintrc.yaml etc.
As far as I can tell, all ESLint config files in m-c are .eslintrc files. Maybe we should rename all the files (either all at once or iteratively)?
Reporter | ||
Comment 1•9 years ago
|
||
Mossop: Do you happen to know if there's a reason why we use the deprecated naming style?
Thanks.
Blocks: eslint
Flags: needinfo?(dtownsend)
Comment 2•9 years ago
|
||
Probably no good reason. I'd happily accept a patch that fixes it.
Flags: needinfo?(dtownsend)
Component: General → ESLint
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → standard8
Comment hidden (mozreview-request) |
Assignee | ||
Comment 4•8 years ago
|
||
Unfortunately mozreview doesn't do a good job of handling file moves :-(
Comment 5•8 years ago
|
||
Out of curiosity, why did you choose .js instead of .json ? Did one of the files have actual code in it instead of a json-like structure?
Reporter | ||
Comment 6•8 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #4)
> Unfortunately mozreview doesn't do a good job of handling file moves :-(
Hmm, did you use |hg mv|? It should represent the moves much nicer if you did.
Assignee | ||
Comment 7•8 years ago
|
||
(In reply to Philipp Kewisch [:Fallen] from comment #5)
> Out of curiosity, why did you choose .js instead of .json ? Did one of the
> files have actual code in it instead of a json-like structure?
.js allows comments, whereas .json does not (at least strictly, and my atom editor also highlights these as invalid). Since a lot of the files have comments in, .js seemed to fit better. It also has the side effect of allowing eslint to lint itself ;-)
(In reply to :Cykesiopka from comment #6)
> (In reply to Mark Banner (:standard8) from comment #4)
> > Unfortunately mozreview doesn't do a good job of handling file moves :-(
>
> Hmm, did you use |hg mv|? It should represent the moves much nicer if you
> did.
I used git mv with git cinnabar to push, see bug 1264000 for the mozreview issue.
Comment 8•8 years ago
|
||
(In reply to Mark Banner (:standard8) from comment #7)
> (In reply to Philipp Kewisch [:Fallen] from comment #5)
> > Out of curiosity, why did you choose .js instead of .json ? Did one of the
> > files have actual code in it instead of a json-like structure?
>
> .js allows comments, whereas .json does not (at least strictly, and my atom
> editor also highlights these as invalid). Since a lot of the files have
> comments in, .js seemed to fit better. It also has the side effect of
> allowing eslint to lint itself ;-)
The self-linting is an interesting argument, thanks. Note that eslint's JSON parser understands comments, see the .eslintrc.json files in security/manager.
Assignee | ||
Comment 9•8 years ago
|
||
(In reply to Philipp Kewisch [:Fallen] from comment #8)
> (In reply to Mark Banner (:standard8) from comment #7)
> > (In reply to Philipp Kewisch [:Fallen] from comment #5)
> > > Out of curiosity, why did you choose .js instead of .json ? Did one of the
> > > files have actual code in it instead of a json-like structure?
> >
> > .js allows comments, whereas .json does not (at least strictly, and my atom
> > editor also highlights these as invalid). Since a lot of the files have
> > comments in, .js seemed to fit better. It also has the side effect of
> > allowing eslint to lint itself ;-)
>
> The self-linting is an interesting argument, thanks. Note that eslint's JSON
> parser understands comments, see the .eslintrc.json files in
> security/manager.
Yeah, I realised that eslint understands comments, but I was verging on the side of sticking closer to the standards (e.g. if we introduce a json linter then we might not be allowing comments).
Comment 10•8 years ago
|
||
mozreview-review |
Comment on attachment 8800433 [details]
Bug 1251003 - Change .eslintrc files to .eslintrc.js to avoid obsolete config file format.
https://reviewboard.mozilla.org/r/85336/#review84234
I can't really review it in this state. Assuming this is just file renames (that are handled correctly in hg) plus the odd update to the extends property then just take a blanket r+. If there is anything else going on here then maybe go old school and attach a patch file to the bug so I can see the changes more clearly.
Attachment #8800433 -
Flags: review?(dtownsend) → review+
Comment 11•8 years ago
|
||
If you want to lint .eslintrc.js files, you will need to unignore them. It seems these files are ignored by default. running mach eslint .eslintrc gives you:
/Users/kewisch/mozilla/comm/calendar/.eslintrc.js
None warning File ignored by default. Use a negated ignore pattern (like "--ignore-pattern '!<relative/path/to/filename>'") to override. (eslint)
Adding !**/.eslintrc.js to .eslintignore will unignore them. I had a few style issues in ours so be sure to check.
Assignee | ||
Comment 12•8 years ago
|
||
(In reply to Philipp Kewisch [:Fallen] from comment #11)
> If you want to lint .eslintrc.js files, you will need to unignore them. It
> seems these files are ignored by default. running mach eslint .eslintrc
> gives you:
>
>
> /Users/kewisch/mozilla/comm/calendar/.eslintrc.js
> None warning File ignored by default. Use a negated ignore pattern
> (like "--ignore-pattern '!<relative/path/to/filename>'") to override.
> (eslint)
>
>
> Adding !**/.eslintrc.js to .eslintignore will unignore them. I had a few
> style issues in ours so be sure to check.
Thank you for pointing that out Philipp, I've added this to the new patch I'm working on, and fixed up the few issues it raised.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 14•8 years ago
|
||
Comment on attachment 8800433 [details]
Bug 1251003 - Change .eslintrc files to .eslintrc.js to avoid obsolete config file format.
Ok, I've now re-done this from a Mercurial based repo & for some reason this seems to have coped with the moves a lot better. Additionally, mozreview seems to cope with the moves as well!
Dave: This is more-or-less file moves, but with additional tops & tails for the files, the new review should show this clearer (even if its a bit slow to load).
There's a few lint fixes for the files now that linting of .eslintrc.js is fixed (thanks to Philipp).
Attachment #8800433 -
Flags: review+ → review?(dtownsend)
Comment 15•8 years ago
|
||
mozreview-review |
Comment on attachment 8800433 [details]
Bug 1251003 - Change .eslintrc files to .eslintrc.js to avoid obsolete config file format.
https://reviewboard.mozilla.org/r/85336/#review85234
Attachment #8800433 -
Flags: review?(dtownsend) → review+
Comment hidden (mozreview-request) |
Comment 17•8 years ago
|
||
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fc2ff940d290
Change .eslintrc files to .eslintrc.js to avoid obsolete config file format. r=mossop
Comment 18•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Updated•7 years ago
|
Product: Testing → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•