eslint-config-woshapp
v12.5.1
Published
Woshapp Linters for Node, React and JS in general
Downloads
345
Readme
Configuration
Some type-aware lint rules in @typescript-eslint require a TSConfig to exist. The project itself does not need to use typescript.
Add the following to .eslintrc.js
:
{
"parserOptions": {
"project": "./tsconfig.json",
},
}
Add e.g. the following to tsconfig.json
:
{
"compilerOptions": {
"target": "es6",
"module": "esnext",
"moduleResolution": "node",
"jsx": "react-jsx",
"allowJs": true,
"checkJs": true,
"noEmit": true,
"experimentalDecorators": true,
"useDefineForClassFields": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"sourceMap": true,
"skipLibCheck": true,
"lib": ["es2021", "dom"]
},
"exclude": ["node_modules"]
}
Node rules
Install
npm install --save-dev eslint-config-woshapp eslint eslint-plugin-import eslint-plugin-n eslint-plugin-promise eslint-plugin-unicorn typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-communist-spelling
Usage
Add the following to .eslintrc.js
:
{
"extends": ["woshapp/node"]
}
React rules
Install
npm install --save-dev eslint-config-woshapp eslint eslint-plugin-import eslint-plugin-n eslint-plugin-promise eslint-plugin-unicorn typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-communist-spelling eslint-plugin-react eslint-plugin-decorator-position eslint-plugin-mobx eslint-plugin-react-hooks
Usage
Add the following to .eslintrc.js
:
{
"extends": ["woshapp/react"]
}
React Native rules
Install
npm install --save-dev eslint-config-woshapp eslint eslint-plugin-import eslint-plugin-n eslint-plugin-promise eslint-plugin-unicorn typescript @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-communist-spelling eslint-plugin-react eslint-plugin-decorator-position eslint-plugin-mobx eslint-plugin-react-hooks eslint-plugin-react-native eslint-plugin-unused-imports
Usage
Add the following to .eslintrc.js
:
{
"extends": ["woshapp/react-native"]
}