eslint-config-woshapp
v15.3.0
Published
Woshapp Linters for Node, React and JS in general
Readme
Configuration
Some type-aware lint rules in @typescript-eslint require a TSConfig to exist. The project itself does not need to use typescript, but a tsconfig should be present.
Requirements:
- ESLint flat config with ESM (
eslint.config.mjs). - ESLint
9.xand@eslint/js9.x. - Node.js
^20.19.0 || ^22.13.0 || >=24. - Your project runtime can still be CommonJS; only the ESLint config file needs to be ESM.
Add the following to eslint.config.mjs:
import baseConfig from 'eslint-config-woshapp'
export default [
...baseConfig,
]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": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"sourceMap": true,
"skipLibCheck": true,
"lib": ["es2024", "dom"]
},
"exclude": ["node_modules"]
}Node rules
Install
npm install --save-dev eslint-config-woshapp globals eslint@^9 @eslint/js@^9 eslint-plugin-import eslint-plugin-n eslint-plugin-promise eslint-plugin-unicorn typescript @stylistic/eslint-plugin @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-communist-spellingUsage
Add the following to eslint.config.mjs:
import nodeConfig from 'eslint-config-woshapp/node'
export default [
...nodeConfig,
]React rules
Install
npm install --save-dev eslint-config-woshapp globals eslint@^9 @eslint/js@^9 @eslint/compat eslint-plugin-import eslint-plugin-n eslint-plugin-promise eslint-plugin-unicorn typescript @stylistic/eslint-plugin @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-communist-spelling eslint-plugin-react eslint-plugin-decorator-position eslint-plugin-mobx eslint-plugin-react-hooksUsage
Add the following to eslint.config.mjs:
import reactConfig from 'eslint-config-woshapp/react'
export default [
...reactConfig,
]React Native rules
Install
npm install --save-dev eslint-config-woshapp globals eslint@^9 @eslint/js@^9 @eslint/compat eslint-plugin-import eslint-plugin-n eslint-plugin-promise eslint-plugin-unicorn typescript @stylistic/eslint-plugin @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 eslint-plugin-prettierUsage
Add the following to eslint.config.mjs:
import reactNativeConfig from 'eslint-config-woshapp/react-native'
export default [
...reactNativeConfig,
]