New Level Up shareable config for ESLint
💡 The purpose of
eslint
is to lintjavascript
andtypescript
files such that it conforms your organization practice. Its also performs automated scans of your files for common syntax, style errors and potential organization based code rule violations.
Install ESLint and @newlevelup/eslint-config
:
npm install --save-dev eslint @newlevelup/eslint-config
@newlevelup/eslint-config
should be used in conjunction with Prettier. See the @newlevelup/prettier-config
installation guide for more details.
New Level Up ESLint rules come bundled in @newlevelup/eslint-config
. To enable these rules, add an eslintConfig
property in your package.json
. See the ESLint configuration docs for more details.
"eslintConfig": {
"extends": ["@newlevelup"]
}
Now you can run ESLint by adding the following scripts to your package.json
. See the ESLint CLI docs for more details.
"scripts": {
"lint:js": "eslint --cache --ignore-path .gitignore .",
"format:js": "yarn lint:js --fix"
}
Lint it:
yarn lint:js
Format it:
yarn format:js