0.4.0 • Published 1 year ago
@envisagesoftware/eslint-config v0.4.0
Envisage ESLint Shareable Config
Basic setup
- Install the following dev dependencies (
npm i -D <package>):
eslint@typescript-eslint/eslint-plugin@typescript-eslint/parsereslint-plugin-jesteslint-plugin-only-warn@envisagesoftware/eslint-config
Create an
.eslintrc.jsonfile in the root of the project (not/src).Add the following:
{
"extends": [
"@envisagesoftware/eslint-config",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript"
],
"rules": {
"import/no-unresolved": "off",
"import/order": [
"warn",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index"
],
"newlines-between": "always-and-inside-groups"
}
]
}
}3a. If you're using webpack, add the following setting:
"settings": {
"import/resolver": "webpack",
...
}3b. If you are using @/ paths, add the following setting:
"settings": {
"import/internal-regex": "^@/.*",
...
}Setup in React projects
- Add the following extensions to your
.eslintrc.json:
"extends": [
"plugin:react/recommended",
"plugin:react-hooks/recommended",
]- Add the following setting:
"settings": {
"react": {
"version": "detect"
},
...
}