Standard rules for Javascript using ESLint implemented as a common configuration.
npm install --save-dev @la-ots/eslint-config
Create .eslintrc.js
file with the following content:
module.exports = {
extends: "@la-ots/eslint-config",
rules: {
// add any overrides if required
},
};
If you're using this plugin with Prettier, add "prettier" at the end of your extends list:
module.exports = {
extends: ["@la-ots/eslint-config", "prettier"],
rules: {
// add any overrides if required
},
};
Add the following scripts to your package.json
:
{
"scripts": {
"lint:js": "eslint **/*.js",
"lint:js:fix": "eslint **/*.js --fix"
}
}
Execute scripts:
npm run lint:js