Skip to content
This repository has been archived by the owner on Apr 3, 2019. It is now read-only.

Switch from JSHint to ESLint #156

Closed
pdehaan opened this issue Jun 9, 2015 · 7 comments
Closed

Switch from JSHint to ESLint #156

pdehaan opened this issue Jun 9, 2015 · 7 comments
Assignees

Comments

@pdehaan
Copy link
Contributor

pdehaan commented Jun 9, 2015

See mozilla/fxa-content-server#2550 and mozilla/fxa-content-server#2537 (comment)

@TDA
Copy link
Contributor

TDA commented Jun 11, 2015

@pdehaan I would be happy to do this once I am done with 2550. I am assuming the same steps? All I would need to do is clone this locally and make similar changes and push and make a PR?

@pdehaan
Copy link
Contributor Author

pdehaan commented Jun 11, 2015

@TDA: I think so. Probably want to verify w/ @shane-tomlinson @zaach and @vladikoff to see if they want to keep both JSHint AND ESLint for a brief time, or if we just use ESLint and remove the old linter all at once.

@shane-tomlinson
Copy link

@TDA: I think so. Probably want to verify w/ @shane-tomlinson @zaach and @vladikoff to see if they want to keep both JSHint AND ESLint for a brief time, or if we just use ESLint and remove the old linter all at once.

Let's keep the two running concurrently for maybe a week, then rip out JSHint.

@pdehaan
Copy link
Contributor Author

pdehaan commented Jun 11, 2015

Also, this was the approach I was thinking of before w/ using an ESLint shareable config:
https://github.com/pdehaan/eslint-config-fxa

Basically we'd have one module of rules that we can share between projects and extend.

Then our .eslintrc file would be something like this:

extends: fxa

Or for you JSON-thusiasts:

{
  "extends": "fxa"
}

With possibly overriding a few rules, envs as needed.

@vladikoff
Copy link
Contributor

Basically we'd have one module of rules that we can share between projects and extend.

Yes please!

@zaach
Copy link
Contributor

zaach commented Jun 11, 2015

Cool idea @pdehaan.

@pdehaan
Copy link
Contributor Author

pdehaan commented Jun 12, 2015

OK, I was testing this locally in a couple fxa-* repos last night and tweaking my client/server rules and have a proof of concept PR at mozilla/fxa-auth-db-server#148

extends: fxa/server

rules:
  handle-callback-err: 0
  semi: 0

It uses all the default "fxa" and "fxa/server" rules in eslint-config-fxa and then disables two additional rules, handle-callback-err and semi. And if we clean up ~10 semicolons we could reenable the semi rule and have it enforce/reject semicolon usage. So each repo has a good set of "default rules" and still has the flexibility to use custom rules as needed. Plus because child .eslintrc files inherit rules from their parents, it's easy enough to add .eslintrc files in subdirectories to add custom environments for /tests/ or whatever.

... And the coolest part, is that I basically was able to copy all of @TDA's rules from the the fxa-content-server repo's .eslintrc file and this "just worked"!

TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 12, 2015
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
@TDA TDA self-assigned this Jun 12, 2015
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 12, 2015
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 12, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 13, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 13, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 13, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 15, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 15, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 15, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 29, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
TDA added a commit to TDA/fxa-js-client that referenced this issue Jun 29, 2015
Fixes mozilla#156
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Add inline rules for ignoring complexity
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants