1.0.5 • Published 6 years ago
@zapd/eslint-config v1.0.5
@zapd/eslint-config
An ESLint shareable config to be used with JS, JSX, TS, and TSX.
Dependencies
Required:
eslint >=5.10.0
babel-eslint >=10.0.1
Optional:
eslint-plugin-react >=7.11.1
eslint-plugin-react-hooks >=1.5.0
eslint-plugin-typescript >=0.14.0
typescript >=3.1.6
typescript-eslint-parser >=21.0.2
Installation
First install ESLint, the babel-eslint
parser, and this package:
npm install --save-dev @zapd/eslint-config eslint@5.10.0 babel-eslint@10.0.1
Then install the optional dependencies you require for your project. If you'll be using this linter with vanilla JS, you won't require any additional dependencies.
React Dependencies:
npm install --save-dev eslint-plugin-react@7.11.1 eslint-plugin-react-hooks@1.5.0
TypeScript Dependencies:
npm install --save-dev eslint-plugin-typescript@0.14.0 typescript@3.1.6 typescript-eslint-parser@21.0.2
NOTE: If you'll be using this linter for both TS and TSX, you will need to download both the React and TypeScript dependencies.
Configuration:
Finally, add this package to your ESLint configuration, under the extends
property in .eslintrc
or similar:
{
"extends": "@zapd/eslint-config"
}
Linting:
To lint files, run ESLint by providing a target directory and file type(s):
node_modules/.bin/eslint TARGET_DIRECTORY --ext FILETYPE_1,FILETYPE_2
Such as:
node_modules/.bin/eslint ./src/ --ext js,jsx,ts,tsx