-
Notifications
You must be signed in to change notification settings - Fork 360
chore: extend eslint recommendations #627
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kumar303 it looks good to me
r+
@@ -13,6 +13,7 @@ | |||
"node": true, | |||
"es6": true | |||
}, | |||
"extends": "eslint:recommended", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, there is also a "plugin:flowtype/recommended" config which you can extend.
"extends": [
"eslint:recommended",
"plugin:flowtype/recommended"
],
Extending that flowtype recommended config now returns 15 errors:
npm run lint
> [email protected] lint /Users/pdehaan/dev/github/mozilla/web-ext
> grunt lint
Running "lint" task
Running "eslint:js" (eslint) task
Done.
➜ web-ext git:(master) subl .
➜ web-ext git:(master) npm run lint
> [email protected] lint /Users/pdehaan/dev/github/mozilla/web-ext
> grunt lint
Running "lint" task
Running "eslint:js" (eslint) task
/Users/pdehaan/dev/github/mozilla/web-ext/src/cmd/build.js
52:20 error There must be a space before union type annotation separator flowtype/union-intersection-spacing
52:20 error There must be a space after union type annotation separator flowtype/union-intersection-spacing
/Users/pdehaan/dev/github/mozilla/web-ext/src/cmd/run.js
309:52 error There must be a space before union type annotation separator flowtype/union-intersection-spacing
309:52 error There must be a space after union type annotation separator flowtype/union-intersection-spacing
/Users/pdehaan/dev/github/mozilla/web-ext/src/cmd/sign.js
136:12 error There must be a space before union type annotation separator flowtype/union-intersection-spacing
136:12 error There must be a space after union type annotation separator flowtype/union-intersection-spacing
170:8 error There must be no space before return type colon flowtype/space-before-type-colon
/Users/pdehaan/dev/github/mozilla/web-ext/src/errors.js
92:16 error There must be a space before union type annotation separator flowtype/union-intersection-spacing
92:16 error There must be a space after union type annotation separator flowtype/union-intersection-spacing
92:39 error There must be a space before union type annotation separator flowtype/union-intersection-spacing
92:39 error There must be a space after union type annotation separator flowtype/union-intersection-spacing
/Users/pdehaan/dev/github/mozilla/web-ext/src/firefox/preferences.js
8:18 error Use "boolean", not "bool" flowtype/boolean-style
/Users/pdehaan/dev/github/mozilla/web-ext/src/util/is-directory.js
17:60 error Use "boolean", not "bool" flowtype/boolean-style
/Users/pdehaan/dev/github/mozilla/web-ext/src/util/manifest.js
71:65 error There must be a space before union type annotation separator flowtype/union-intersection-spacing
71:65 error There must be a space after union type annotation separator flowtype/union-intersection-spacing
✖ 15 problems (15 errors, 0 warnings)
Warning: Task "eslint:js" failed. Use --force to continue.
Aborted due to warnings.
Good news is that all the issues can be auto-fixed using:
$ ./node_modules/.bin/eslint tasks tests src Gruntfile.js webpack.config.js --fix
Although it does give me one error (which seems to be a max-len
violation due to auto-formatted code):
$ npm run lint
> [email protected] lint /Users/pdehaan/dev/github/mozilla/web-ext
> grunt lint
Running "lint" task
Running "eslint:js" (eslint) task
/Users/pdehaan/dev/github/mozilla/web-ext/src/cmd/sign.js
170:1 error Line 170 exceeds the maximum line length of 80 max-len
✖ 1 problem (1 error, 0 warnings)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I didn't know about that. I added it in #631
No description provided.