Skip to content

chore: switch from JSHint to ESLint#317

Closed
ariporad wants to merge 7 commits intomasterfrom
eslint
Closed

chore: switch from JSHint to ESLint#317
ariporad wants to merge 7 commits intomasterfrom
eslint

Conversation

@ariporad
Copy link
Copy Markdown
Contributor

This PR switches us from JSHint to ESLint.

ESLint checks both lint errors and style.

We're using AirBnB's Style Guide as a starting point.

Since there are about 1700 lint errors, which I couldn't possibly hope to do myself, this PR is going to be done slightly differently. While this PR will remain open, Me and @nfischer will accept PRs against _this_ branch fixing a small number of lint errors (Please do one file per PR). Then, once the number of lint errors is 0, we'll squash everything and merge into master.

Current Lint Problem Count for this branch: 794

@ariporad ariporad added this to the v0.6.0 milestone Jan 29, 2016
@ariporad ariporad force-pushed the eslint branch 2 times, most recently from 5b58cde to d4e6adc Compare January 29, 2016 01:42
ariporad added a commit that referenced this pull request Jan 29, 2016
This is an example PR for how to make PRs against #317.
@nfischer
Copy link
Copy Markdown
Member

@ariporad is this up to date with master? It looks like it's failing Windows CI.

Also, it looks like something is undefined in run-tests.js

@ariporad
Copy link
Copy Markdown
Contributor Author

@nfischer: It's up to date with master, but the lint stage is failing _badly_

@ariporad
Copy link
Copy Markdown
Contributor Author

@nfischer: Oh, actually, spawnSync isn't available on node v0.10. Fixed.

ariporad added a commit that referenced this pull request Jan 29, 2016
This is an example PR for how to make PRs against #317.
@nfischer nfischer modified the milestones: v1.0.0, v0.6.0 Jan 30, 2016
@nfischer
Copy link
Copy Markdown
Member

@ariporad I changed the milestone, since I don't think we should push off 0.6 just so we can switch lint tools

.eslintrc Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should prefer .eslintrc.json as the file name. "raw" .eslintrc files are deprecated.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch

@BYK
Copy link
Copy Markdown
Contributor

BYK commented Jan 30, 2016

I'm willing to help with this. Have you tried using the --fix option to get some of these fixed autoamtically?

@ariporad
Copy link
Copy Markdown
Contributor Author

@BYK: Oops... I forgot about that.

ariporad added a commit that referenced this pull request Jan 31, 2016
This is an example PR for how to make PRs against #317.
@ariporad
Copy link
Copy Markdown
Contributor Author

@BYK: Fixed.

@BYK
Copy link
Copy Markdown
Contributor

BYK commented Feb 1, 2016

Adding the following to the rule set helps a lot:

"spaced-comment": [2, "always", { "markers": ["@"], "exceptions": ["@"] }]

ariporad added a commit that referenced this pull request Feb 1, 2016
This is an example PR for how to make PRs against #317.
@BYK
Copy link
Copy Markdown
Contributor

BYK commented Feb 1, 2016

Looks like this is the problem:

/home/travis/build/shelljs/shelljs/test/which.js
18:5  error  "result" is already defined  no-redeclare

@BYK
Copy link
Copy Markdown
Contributor

BYK commented Feb 1, 2016

FYI I didn't try to fix all warnings so the warnings are expected. no-param-reassign is extensively violated and requires some fundamental changes in a few places so I didn't bother fixing them.

Also I'm not sure AirBnB style guide was a good choice since it looks a bit too browser oriented.

@BYK
Copy link
Copy Markdown
Contributor

BYK commented Feb 1, 2016

(Please do one file per PR)

lol - sorry for not following this :D

@ariporad
Copy link
Copy Markdown
Contributor Author

ariporad commented Feb 1, 2016

Don't worry, it didn't end up making a difference.

@TimothyGu
Copy link
Copy Markdown
Contributor

Umm… is there a reason why this is high priority?

@nfischer
Copy link
Copy Markdown
Member

I feel like this should be a low priority issue. Lengthy chores probably shouldn't be high priority. I think only in-demand features and bug fixes (and issues blocking those) should be high priority

@ariporad
Copy link
Copy Markdown
Contributor Author

Oh, yeah, that was a mistake. Fixed.

@nfischer
Copy link
Copy Markdown
Member

@ariporad any further work on this? This might be nice to start transitioning to using.

@nfischer nfischer mentioned this pull request Aug 6, 2016
@ariporad ariporad closed this in #504 Aug 7, 2016
@nfischer nfischer deleted the eslint branch June 18, 2017 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants