@quitsmx/eslint-config
Version:
Customized ESLint config for TypeScript + React or Preact + Prettierx
79 lines (78 loc) • 3.22 kB
JSON
{
"plugins": ["react", "react-hooks"],
"settings": {
"linkComponents": [{ "name": "Link", "linkAttribute": "to" }],
"react": { "version": "detect" }
},
"parserOptions": { "ecmaVersion": 2020, "ecmaFeatures": { "jsx": true } },
"env": { "es2020": true, "browser": true },
"rules": {
"react-hooks/exhaustive-deps": "warn",
"react-hooks/rules-of-hooks": "error",
"react/button-has-type": "error",
"react/forbid-foreign-prop-types": "warn",
"react/no-access-state-in-setstate": "warn",
"react/no-array-index-key": "warn",
"react/no-children-prop": "error",
"react/no-danger-with-children": "error",
"react/no-deprecated": "error",
"react/no-did-mount-set-state": "warn",
"react/no-did-update-set-state": "error",
"react/no-direct-mutation-state": "error",
"react/no-find-dom-node": "error",
"react/no-is-mounted": "error",
"react/no-multi-comp": ["warn", { "ignoreStateless": true }],
"react/no-redundant-should-component-update": "error",
"react/no-render-return-value": "error",
"react/no-string-refs": ["error", { "noTemplateLiterals": true }],
"react/no-this-in-sfc": "error",
"react/no-typos": "warn",
"react/no-unescaped-entities": [
"error",
{
"forbid": [
{ "char": "\"", "alternatives": ["""] },
{ "char": ">", "alternatives": [">"] },
{ "char": "}", "alternatives": ["}"] }
]
}
],
"react/no-unknown-property": "error",
"react/no-unused-prop-types": "error",
"react/no-will-update-set-state": "error",
"react/require-render-return": "error",
"react/self-closing-comp": "error",
"react/style-prop-object": "error",
"react/void-dom-elements-no-children": "error",
"react/jsx-boolean-value": "error",
"react/jsx-filename-extension": ["error", { "extensions": [".tsx", ".jsx"] }],
"react/jsx-fragments": ["error", "syntax"],
"react/jsx-key": ["error", { "checkFragmentShorthand": true }],
"react/jsx-max-depth": ["error", { "max": 6 }],
"react/jsx-no-bind": "error",
"react/jsx-no-comment-textnodes": "error",
"react/jsx-no-duplicate-props": "error",
"react/jsx-no-script-url": ["error", [{ "name": "Link", "props": ["to"] }]],
"react/jsx-no-target-blank": ["error", { "enforceDynamicLinks": "always" }],
"react/jsx-no-undef": ["error", { "allowGlobals": true }],
"react/jsx-no-useless-fragment": "error",
"react/jsx-pascal-case": ["error", { "allowAllCaps": false }],
"react/jsx-uses-react": "warn",
"react/jsx-uses-vars": "error",
"react/jsx-child-element-spacing": "off",
"react/jsx-closing-bracket-location": "off",
"react/jsx-closing-tag-location": "off",
"react/jsx-curly-newline": "off",
"react/jsx-curly-spacing": "off",
"react/jsx-equals-spacing": "off",
"react/jsx-first-prop-new-line": "off",
"react/jsx-indent": "off",
"react/jsx-indent-props": "off",
"react/jsx-max-props-per-line": "off",
"react/jsx-newline": "off",
"react/jsx-one-expression-per-line": "off",
"react/jsx-props-no-multi-spaces": "off",
"react/jsx-tag-spacing": "off",
"react/jsx-wrap-multilines": "off"
}
}