add eslint rules for react hooks

This commit is contained in:
HF 2024-01-23 20:08:07 +01:00
parent 94f872e536
commit 61c1d1d2b6

View File

@ -1,7 +1,5 @@
{ {
"extends": [ "extends": [ "airbnb", "airbnb/hooks" ],
"airbnb"
],
"parser":"@babel/eslint-parser", "parser":"@babel/eslint-parser",
"parserOptions": { "parserOptions": {
"babelOptions":{ "babelOptions":{
@ -27,8 +25,8 @@
"function-paren-newline": "off", "function-paren-newline": "off",
"function-call-argument-newline":"off", "function-call-argument-newline":"off",
"max-len": [1, 80, 2, {"ignoreComments": true}], "max-len": [1, 80, 2, {"ignoreComments": true}],
"no-bitwise": 0, "no-bitwise": "off",
"no-restricted-syntax": 0, "no-restricted-syntax": "off",
"no-plusplus" : "off", "no-plusplus" : "off",
"no-param-reassign": "off", "no-param-reassign": "off",
"no-mixed-operators":"off", "no-mixed-operators":"off",
@ -36,7 +34,7 @@
"react/jsx-one-expression-per-line": "off", "react/jsx-one-expression-per-line": "off",
"react/jsx-closing-tag-location": "off", "react/jsx-closing-tag-location": "off",
"react/jsx-key": "warn", "react/jsx-key": "warn",
"react-hooks/rules-of-hooks": "error", "react-hooks/rules-of-hooks": "warn",
"jsx-a11y/click-events-have-key-events":"off", "jsx-a11y/click-events-have-key-events":"off",
"jsx-a11y/no-static-element-interactions":"off", "jsx-a11y/no-static-element-interactions":"off",
"jsx-a11y/control-has-associated-label": "off", "jsx-a11y/control-has-associated-label": "off",