141 lines
3.6 KiB
Plaintext
141 lines
3.6 KiB
Plaintext
{
|
|
"root": true,
|
|
"parser": "@typescript-eslint/parser",
|
|
"plugins": ["@typescript-eslint", "react"],
|
|
"extends": [
|
|
"plugin:jsx-control-statements/recommended"
|
|
],
|
|
"settings": {
|
|
"react": {
|
|
"version": "detect"
|
|
}
|
|
},
|
|
"globals": {
|
|
"document": true,
|
|
"window": true
|
|
},
|
|
"ignorePatterns": [
|
|
"**/dist/*.js",
|
|
"**/node_modules"
|
|
],
|
|
"rules": {
|
|
"semi": ["error", "never"],
|
|
"curly": ["error", "all"],
|
|
"object-curly-spacing": ["error", "always"],
|
|
"no-trailing-spaces": "error",
|
|
"max-len": ["error", 120],
|
|
"indent": ["error", 2],
|
|
"eol-last": "error",
|
|
"prefer-const": "error",
|
|
"no-console": "error",
|
|
"no-else-return": "warn",
|
|
"comma-dangle": ["error", "always-multiline"],
|
|
"padding-line-between-statements": ["error",
|
|
{
|
|
"blankLine": "always",
|
|
"prev": ["let", "const"],
|
|
"next": "*"
|
|
},
|
|
{
|
|
"blankLine": "always",
|
|
"prev": "*",
|
|
"next": ["let", "const"]
|
|
},
|
|
{
|
|
"blankLine": "any",
|
|
"prev": ["singleline-let", "singleline-const"],
|
|
"next": ["singleline-let", "singleline-const"]
|
|
},
|
|
{
|
|
"blankLine": "always",
|
|
"prev": "*",
|
|
"next": [
|
|
"if",
|
|
"block",
|
|
"return",
|
|
"multiline-block-like",
|
|
"multiline-expression"
|
|
]
|
|
},
|
|
{
|
|
"blankLine": "always",
|
|
"prev": [
|
|
"block-like",
|
|
"multiline-block-like",
|
|
"multiline-expression"
|
|
],
|
|
"next": "*"
|
|
}
|
|
],
|
|
"quotes": ["error", "single"],
|
|
"jsx-quotes": ["error", "prefer-double"],
|
|
"react/jsx-no-undef": [2, { "allowGlobals": true }],
|
|
"react/function-component-definition": [2, {
|
|
"namedComponents": "arrow-function",
|
|
"unnamedComponents": "arrow-function"
|
|
}],
|
|
"react/no-redundant-should-component-update": "warn",
|
|
"react/no-unused-state": "error",
|
|
"react/self-closing-comp": ["error", {
|
|
"html": true,
|
|
"component": true
|
|
}],
|
|
"react/sort-comp": ["error", {
|
|
"order": [
|
|
"static-methods",
|
|
"lifecycle",
|
|
"everything-else",
|
|
"/^handle.+$/",
|
|
"rendering"
|
|
],
|
|
"groups": {
|
|
"rendering": [
|
|
"'/^render.+$/'",
|
|
"render"
|
|
]
|
|
}
|
|
}],
|
|
"react/jsx-closing-bracket-location": ["error", "tag-aligned"],
|
|
"react/jsx-closing-tag-location": "error",
|
|
"react/jsx-equals-spacing": ["error", "never"],
|
|
"react/jsx-first-prop-new-line": 0,
|
|
"react/jsx-fragments": ["error", "element"],
|
|
"react/jsx-handler-names": ["error", {
|
|
"eventHandlerPrefix": "handle",
|
|
"eventHandlerPropPrefix": "on"
|
|
}],
|
|
"react/jsx-max-props-per-line": ["error", {
|
|
"maximum": 2
|
|
}],
|
|
"react/jsx-tag-spacing": ["error", {
|
|
"beforeSelfClosing": "always"
|
|
}],
|
|
"react/jsx-sort-props": ["warn", {
|
|
"shorthandFirst": true,
|
|
"callbacksLast": true,
|
|
"noSortAlphabetically": true
|
|
}],
|
|
"jsx-control-statements/jsx-jcs-no-undef": "off"
|
|
},
|
|
"overrides": [
|
|
{
|
|
"files": [
|
|
"**/*.ts?(x)"
|
|
],
|
|
"rules": {
|
|
"indent": "off",
|
|
"space-infix-ops": "off",
|
|
"@typescript-eslint/space-infix-ops": ["error"],
|
|
"@typescript-eslint/no-shadow": "warn",
|
|
"@typescript-eslint/indent": ["error", 2],
|
|
"@typescript-eslint/type-annotation-spacing": ["error"],
|
|
"@typescript-eslint/space-before-function-paren": ["error", {
|
|
"named": "never",
|
|
"anonymous": "always",
|
|
"asyncArrow": "always"
|
|
}]
|
|
}
|
|
}
|
|
]
|
|
}
|