generated from nhcarrigan/template
Reviewed-on: https://codeberg.org/nhcarrigan/eslint-config/pulls/4 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
88 lines
4.2 KiB
TypeScript
88 lines
4.2 KiB
TypeScript
/**
|
|
* @copyright nhcarrigan
|
|
* @license Naomi's Public License
|
|
* @author Naomi Carrigan
|
|
*/
|
|
|
|
import type { Linter } from "eslint";
|
|
|
|
export const reactRules: Linter.RulesRecord = {
|
|
"react/boolean-prop-naming": "warn",
|
|
"react/button-has-type": "error",
|
|
"react/checked-requires-onchange-or-readonly": "error",
|
|
"react/default-props-match-prop-types": "warn",
|
|
"react/destructuring-assignment": "warn",
|
|
"react/display-name": "warn",
|
|
"react/forbid-foreign-prop-types": "warn",
|
|
"react/forbid-prop-types": "warn",
|
|
"react/forward-ref-uses-ref": "warn",
|
|
"react/function-component-definition":
|
|
[ "warn",
|
|
{
|
|
namedComponents: "arrow-function",
|
|
unnamedComponents: "arrow-function",
|
|
} ],
|
|
"react/hook-use-state": "warn",
|
|
"react/iframe-missing-sandbox": "error",
|
|
"react/jsx-boolean-value": [ "warn", "always" ],
|
|
"react/jsx-child-element-spacing": "warn",
|
|
"react/jsx-filename-extension":
|
|
[ "warn", { allow: "as-needed", extensions: [ ".jsx", ".tsx" ] } ],
|
|
"react/jsx-fragments": [ "warn", "syntax" ],
|
|
"react/jsx-handler-names": "warn",
|
|
"react/jsx-key": "error",
|
|
"react/jsx-no-bind": "error",
|
|
"react/jsx-no-comment-textnodes": "error",
|
|
"react/jsx-no-constructed-context-values": "error",
|
|
"react/jsx-no-duplicate-props": "error",
|
|
"react/jsx-no-leaked-render": "error",
|
|
"react/jsx-no-literals": "warn",
|
|
"react/jsx-no-script-url": "error",
|
|
"react/jsx-no-target-blank": "error",
|
|
"react/jsx-no-undef": "error",
|
|
"react/jsx-no-useless-fragment": "warn",
|
|
"react/jsx-pascal-case": "warn",
|
|
"react/jsx-props-no-spread-multi": "warn",
|
|
"react/jsx-sort-props": "warn",
|
|
"react/jsx-uses-vars": "warn",
|
|
"react/no-access-state-in-setstate": "error",
|
|
"react/no-array-index-key": "error",
|
|
"react/no-arrow-function-lifecycle": "warn",
|
|
"react/no-children-prop": "error",
|
|
"react/no-danger": "error",
|
|
"react/no-danger-with-children": "error",
|
|
"react/no-deprecated": "warn",
|
|
"react/no-did-mount-set-state": "error",
|
|
"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",
|
|
"react/no-object-type-as-default-prop": "error",
|
|
"react/no-redundant-should-component-update": "warn",
|
|
"react/no-render-return-value": "error",
|
|
"react/no-string-refs": "error",
|
|
"react/no-this-in-sfc": "error",
|
|
"react/no-typos": "warn",
|
|
"react/no-unescaped-entities": "error",
|
|
"react/no-unknown-property": "error",
|
|
"react/no-unsafe": "warn",
|
|
"react/no-unstable-nested-components": "warn",
|
|
"react/no-unused-class-component-methods": "warn",
|
|
"react/no-unused-prop-types": "warn",
|
|
"react/no-unused-state": "warn",
|
|
"react/no-will-update-set-state": "error",
|
|
"react/prefer-es6-class": "warn",
|
|
"react/prefer-read-only-props": "error",
|
|
"react/prefer-stateless-function": "warn",
|
|
"react/prop-types": "warn",
|
|
"react/require-default-props": "warn",
|
|
"react/require-render-return": "error",
|
|
"react/self-closing-comp":
|
|
[ "warn", { component: false, html: false } ],
|
|
"react/state-in-constructor": "warn",
|
|
"react/static-property-placement": "warn",
|
|
"react/style-prop-object": "warn",
|
|
"react/void-dom-elements-no-children": "error",
|
|
};
|