JSHint to ESLint && modifying code (i.e. ES2015) #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JSHint to ESLint && modifying code (i.e ES2015), for the migration see migrating-to-eslint
Why changed the code?
I changed the code to make it compatible with the ES2015 standard, and for that you used ESLint. And I removed everything related to JSHint whose configuration is no longer compatible with the new code.
Why Switching from JSHint to ESLint?
ESlint integration and configuration
I start by installing the necessary by typing :
$ npm install -g polyjuice
for more details of polyjuice Click here.$ polyjuice --jshint .jshintrc> .eslintrc
for automatic conversion from jshint to eslint and automatic creation of.eslintrc
.And then add extends:
'usecases/usecase/nodejs'
in .eslintrcThen go to
package.json
and add in the script:For the
.eslintignore
file create it manually and add the lines of the.jshintignore
file:Manual correct of errors
To fix some errors automatically I run
$ npm run eslint:fix
and there will be still some errors to fix manually.To fix them or ignore them I follow ESLint rules.
If you choose to stay on JSHint you will need to add a configuration
An example of a minimal configuration :
and not forget to run
$ npm install --save-dev jshint