179 lines
4.1 KiB
JSON
179 lines
4.1 KiB
JSON
{
|
|
"extends": [
|
|
"plugin:@nx/react",
|
|
"../../.eslintrc.base.json"
|
|
],
|
|
"ignorePatterns": [
|
|
"!**/*"
|
|
],
|
|
"overrides": [
|
|
{
|
|
"files": [
|
|
"**/*.ts",
|
|
"**/*.tsx"
|
|
],
|
|
"parser": "@typescript-eslint/parser",
|
|
"settings": {
|
|
"react": {
|
|
"version": "detect"
|
|
},
|
|
"import/resolver": {
|
|
"typescript": {},
|
|
"alias": {
|
|
"map": [
|
|
[
|
|
"@",
|
|
"./src"
|
|
]
|
|
],
|
|
"extensions": [
|
|
".ts",
|
|
".tsx",
|
|
".js",
|
|
".jsx",
|
|
".json"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"env": {
|
|
"browser": true,
|
|
"node": true,
|
|
"es6": true
|
|
},
|
|
"extends": [
|
|
"eslint:recommended",
|
|
"plugin:import/errors",
|
|
"plugin:import/warnings",
|
|
"plugin:import/typescript",
|
|
"plugin:@typescript-eslint/recommended",
|
|
"plugin:react/recommended",
|
|
"plugin:react-hooks/recommended",
|
|
//"plugin:jsx-a11y/recommended",
|
|
"plugin:prettier/recommended",
|
|
"plugin:testing-library/react",
|
|
"plugin:jest-dom/recommended",
|
|
"plugin:vitest/legacy-recommended"
|
|
],
|
|
"rules": {
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react-hooks/exhaustive-deps": "warn",
|
|
"import/no-restricted-paths": [
|
|
"error",
|
|
{
|
|
"zones": [
|
|
// Previous restrictions...
|
|
// enforce unidirectional codebase:
|
|
// e.g. src/app can import from src/features but not the other way around
|
|
{
|
|
"target": "./src/features",
|
|
"from": "./src/app"
|
|
},
|
|
{
|
|
"target": [
|
|
"./src/components",
|
|
"./src/hooks",
|
|
"./src/lib",
|
|
"./src/types",
|
|
"./src/utils"
|
|
],
|
|
"from": [
|
|
"./src/features",
|
|
"./src/app"
|
|
]
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"import/no-cycle": "off",
|
|
"linebreak-style": [
|
|
"error",
|
|
"unix"
|
|
],
|
|
"react/prop-types": "error",
|
|
"import/order": [
|
|
"error",
|
|
{
|
|
"groups": [
|
|
"builtin",
|
|
"external",
|
|
"internal",
|
|
"parent",
|
|
"sibling",
|
|
"index",
|
|
"object"
|
|
],
|
|
"newlines-between": "always",
|
|
"alphabetize": {
|
|
"order": "asc",
|
|
"caseInsensitive": true
|
|
}
|
|
}
|
|
],
|
|
"import/default": "off",
|
|
"import/no-named-as-default-member": "off",
|
|
"import/no-named-as-default": "off",
|
|
"react/react-in-jsx-scope": "off",
|
|
"jsx-a11y/anchor-is-valid": "off",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error"
|
|
],
|
|
"@typescript-eslint/explicit-function-return-type": [
|
|
"off"
|
|
],
|
|
"@typescript-eslint/explicit-module-boundary-types": [
|
|
"off"
|
|
],
|
|
"@typescript-eslint/no-empty-function": [
|
|
"off"
|
|
],
|
|
"@typescript-eslint/no-explicit-any": [
|
|
"off"
|
|
],
|
|
"@typescript-eslint/indent": "off",
|
|
"prettier/prettier": [
|
|
"error",
|
|
{
|
|
"singleQuote": true,
|
|
"trailingComma": "all",
|
|
"printWidth": 80,
|
|
"tabWidth": 2,
|
|
"useTabs": false,
|
|
"jsxBracketSameLine": false
|
|
}
|
|
]
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"./src/components/**/*.{ts,tsx}"
|
|
],
|
|
"rules": {
|
|
"react/prop-types": "off"
|
|
}
|
|
},
|
|
{
|
|
"files": [
|
|
"*.ts",
|
|
"*.tsx",
|
|
"*.js",
|
|
"*.jsx"
|
|
],
|
|
"rules": {}
|
|
},
|
|
{
|
|
"files": [
|
|
"*.ts",
|
|
"*.tsx"
|
|
],
|
|
"rules": {}
|
|
},
|
|
{
|
|
"files": [
|
|
"*.js",
|
|
"*.jsx"
|
|
],
|
|
"rules": {}
|
|
}
|
|
]
|
|
} |