Shareable ESLint config for my JS projects.
Run the following in your project directory:
npm install eslint @raing3/eslint-config --save-dev
Javascript:
Add the following to your ESLint config file:
{
"extends": ["@raing3/eslint-config"]
}
TypeScript:
Install the TypeScript ESLint plugin:
npm install @typescript-eslint/eslint-plugin @typescript-eslint/parser --save-dev
Add the following to your ESLint config file:
{
"extends": ["@raing3/eslint-config/typescript"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"projec,t": ["./tsconfig.json"]
}
}
React:
Install the React ESLint plugin;
npm install eslint-plugin-react --save-dev
Add the following to your ESLint config file:
{
"extends": ["@raing3/eslint-config/react"],
"settings": {
"react": {
"version": "detect"
}
}
}
Jest:
Install the Jest ESLint plugin:
npm install eslint-plugin-jest --save-dev
Add the following to your ESLint config file:
{
"extends": ["@raing3/eslint-config/jest"],
"env": {
"jest": true
}
}