-
Notifications
You must be signed in to change notification settings - Fork 18
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
Introduce ESLint #10
Introduce ESLint #10
Conversation
I did use I would also suggest to sort the rules alphabetically. This is as well how they are presented in their documentation and adds some easiness and expectation when reading the configuration. |
"Promise": false | ||
}, | ||
"rules": { | ||
"no-bitwise": 2, |
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.
According to the documentation http://eslint.org/docs/rules/no-bitwise and even to previous versions of the documentation (https://github.com/eslint/eslint/blob/master/docs/rules/no-bitwise.md) "no-bitwise"
should not admit a number as a value. Additionally, configuring "extends": "eslint:recommended"
would also bring this by default as an error, and if ESLint changes the API for this rule we wouldn't need to worry about it in the future.
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.
@orioltf, every rule takes a number, if I'm not mistaken: http://eslint.org/docs/user-guide/configuring#configuring-rules
'./source/demo/pages/**/*.js', | ||
'!./source/modules/.scaffold/scaffold.js' | ||
], | ||
watch: [ |
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.
@flavaflo, if the task has its own watcher, we should probably remove it as a dependency of the js
task: https://github.com/unic/estatico/blob/feature/ESTATICO-170-eslint/gulp/js/default.js#L150 (and add it to build
, instead).
Otherwise, every change to a JS file will trigger the linting twice when using --skipWebpackWatch
. Once directly and once as a dependency of the js
task.
@orioltf, alphabetical sorting added. Do you want to go through the rules and compare them with |
// Automatically fix invalid code (files would have to be saved back to disk below) | ||
// fix: true | ||
})) | ||
.pipe(jshint.reporter('jshint-stylish')) |
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.
@backflip we can now remove jshint-stylish
also from the package.json
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.
@backflip Yes, let's move this forward and re-adjust ESLint config based on projects feedback.
…L-95-c_09-tab-tasks-frontend to develop * commit 'dc7ae10bb4c7c8025fa4893ef94bd4229f2699f2': CONCOREL-95: Make sure that active collapsible can be closed. CONCOREL-95: Add tabs-to-collapsible functionality with styles CONCOREL-95: Refactor accordion styles and structure to make it more reusable
.jsx
proved to be difficult to handle with JSHint.eslintrc
from previous.jshintrc
and.jscs
files (using https://www.npmjs.com/package/polyjuice). Minor adaptations where needed (see specific commit).var
declaration but separatingrequire
is not (yet) possible with ESLint (might be fixed in the future Support separate requires in one-var eslint/eslint#6175). That's why I have combined these declarations in the.data.js
files. An alternative would be to disable theone-var
rule.// eslint-disable-line