standardizes the eslint rules and lint npm scripts
MODIFY
.eslintrc.js
.eslintrc.js
module.exports = {
extends: ['airbnb', 'plugin:prettier/recommended'],
env: {
- es6: true,
- mocha: true,
+ es6: true, // supports new ES6 globals (e.g., new types such as Set)
},
rules: {
'implicit-arrow-linebreak': 'off',
@@ -10,5 +9,9 @@ module.exports = {
'arrow-parens': 'off',
strict: 'off',
'no-console': 'off',
+ 'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
+ 'no-return-assign': 'off',
+ 'no-param-reassign': 'off',
+ 'no-restricted-syntax': ['off', 'ForOfStatement'],
},
};

MODIFY
package.json
package.json
"main": "src/index.js",
"scripts": {
"test": "node test/test.js",
- "pretty-fix": "prettier --write '**/*.{js,jsx}'",
- "pretty-check": "prettier --check '**/*.{js,jsx}'",
"lint-fix": "eslint --fix '**/*.{js,jsx}'",
"lint-check": "eslint '**/*.{js,jsx}'"
},

standardizes the eslint rules and lint npm scripts