Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

[WIP] Eslint integration #70

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

[WIP] Eslint integration #70

wants to merge 8 commits into from

Conversation

duckontheweb
Copy link
Contributor

@duckontheweb duckontheweb commented Nov 21, 2017

This removes jshint and jscs as the linters and replaces them with eslint. An attempt was made to keep the rules as consistent as possible during the transition. However, there were a few areas where it seemed more appropriate to bring the code inline with the linting rules rather than adjusting the rules accordingly (see 60f82a8, 55dcbe9, and c28f3da).

@wbyoung If you would like, I can turn back on some of the default airbnb rules and bring the code base up to speed with those, but I'd like to get guidance from you first on how you would like to proceed.

Addresses #67.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling c28f3da on duckontheweb:eslint into 498ee49 on wbyoung:master.

@@ -0,0 +1,10 @@
env:
Copy link

Choose a reason for hiding this comment

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

yaml config is super weird; can these all use .eslintrc instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'm totally open to any format. I can change that over.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed in 3cde23a

@duckontheweb
Copy link
Contributor Author

@wbyoung It looks like the checks are failing because the latest version of eslint requires node >= v4 and the TravisCI build uses v0.12.7:

$ npm view eslint engines
> { node: '>=4' }

I briefly tried to resolve this by using an earlier version of eslint. The problem is that the eslint-config-airbnb* packages have a slew of dependencies and we would need to be very specific in which ones we pulled. I can do this if you'd like, but I'm wondering if it would be easier to upgrade the Travis Node version to one of the LTS version above v4.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling f55a721 on duckontheweb:eslint into 498ee49 on wbyoung:master.

@coveralls
Copy link

coveralls commented Nov 21, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 3cde23a on duckontheweb:eslint into 498ee49 on wbyoung:master.

@ljharb
Copy link

ljharb commented Nov 22, 2017

@duckontheweb the solution there is to not run the linter in every matrix build, but to explicitly include it, and only run it in lts/*. There's no reason to run the linter more than once :-)

See https://github.com/ljharb/is-callable/blob/master/.travis.yml#L22-L33 for an example of many travis-ci best practices.

@@ -0,0 +1,15 @@
{
"env": {
"es6": "off"
Copy link

Choose a reason for hiding this comment

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

why is a file named "es6" turning off the es6 env?

also, why is this a separate file at all, instead of just being in the root eslintrc?

return installedPlugins().then(function(plugins) {
return Promise.all(plugins.map(function(plugin) {
return installedPlugins().then(function(_plugins) {
return Promise.all(_plugins.map(function(plugin) {
Copy link

Choose a reason for hiding this comment

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

the no-underscore-dangle rule should be erroring here; can we pick a better name, like installedPlugins?

npm.config.set('global', true);
npm.config.set('depth', 0);
return Promise.promisify(npm.commands.list)([], true);
.then(function(_npm) {
Copy link

Choose a reason for hiding this comment

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

same throughout; let's please not add leading underscores to things :-)

@@ -11,8 +11,8 @@
"avn": "./bin-public/avn"
},
"scripts": {
"test": "jshint . && jscs . && istanbul cover node_modules/.bin/_mocha --report html --",
"test-travis": "jshint . && jscs . && istanbul cover node_modules/.bin/_mocha --report lcovonly --"
"test": "eslint lib && istanbul cover node_modules/.bin/_mocha --report html --",
Copy link

Choose a reason for hiding this comment

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

i'd recommend adding this in "pretest": "eslint lib". Also, eslint should run on the entire project - ie, eslint . - and .eslintignore should be used if you need to ignore linting files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants