|
| 1 | +import type { RulePreset } from "@eslint-react/types"; |
| 2 | +import reactDebug from "eslint-plugin-react-debug"; |
| 3 | +import reactHooksExtra from "eslint-plugin-react-hooks-extra"; |
| 4 | +import reactNamingConvention from "eslint-plugin-react-naming-convention"; |
| 5 | +import reactWebApi from "eslint-plugin-react-web-api"; |
| 6 | + |
| 7 | +import * as core from "./core"; |
| 8 | +import * as dom from "./dom"; |
| 9 | + |
| 10 | +export const name = "@eslint-react/all"; |
| 11 | + |
| 12 | +export const rules = { |
| 13 | + "@eslint-react/avoid-shorthand-boolean": "warn", |
| 14 | + "@eslint-react/avoid-shorthand-fragment": "warn", |
| 15 | + "@eslint-react/ensure-forward-ref-using-ref": "warn", |
| 16 | + "@eslint-react/jsx-no-duplicate-props": "warn", |
| 17 | + "@eslint-react/jsx-uses-vars": "warn", |
| 18 | + "@eslint-react/no-access-state-in-setstate": "error", |
| 19 | + "@eslint-react/no-array-index-key": "warn", |
| 20 | + "@eslint-react/no-children-count": "warn", |
| 21 | + "@eslint-react/no-children-for-each": "warn", |
| 22 | + "@eslint-react/no-children-map": "warn", |
| 23 | + "@eslint-react/no-children-only": "warn", |
| 24 | + "@eslint-react/no-children-prop": "warn", |
| 25 | + "@eslint-react/no-children-to-array": "warn", |
| 26 | + "@eslint-react/no-class-component": "warn", |
| 27 | + "@eslint-react/no-clone-element": "warn", |
| 28 | + "@eslint-react/no-comment-textnodes": "warn", |
| 29 | + "@eslint-react/no-complex-conditional-rendering": "warn", |
| 30 | + "@eslint-react/no-component-will-mount": "error", |
| 31 | + "@eslint-react/no-component-will-receive-props": "error", |
| 32 | + "@eslint-react/no-component-will-update": "error", |
| 33 | + "@eslint-react/no-create-ref": "error", |
| 34 | + "@eslint-react/no-default-props": "error", |
| 35 | + "@eslint-react/no-direct-mutation-state": "error", |
| 36 | + "@eslint-react/no-duplicate-key": "error", |
| 37 | + "@eslint-react/no-implicit-key": "warn", |
| 38 | + "@eslint-react/no-missing-component-display-name": "warn", |
| 39 | + "@eslint-react/no-missing-key": "error", |
| 40 | + "@eslint-react/no-nested-components": "error", |
| 41 | + "@eslint-react/no-prop-types": "error", |
| 42 | + "@eslint-react/no-redundant-should-component-update": "error", |
| 43 | + "@eslint-react/no-set-state-in-component-did-mount": "warn", |
| 44 | + "@eslint-react/no-set-state-in-component-did-update": "warn", |
| 45 | + "@eslint-react/no-set-state-in-component-will-update": "warn", |
| 46 | + "@eslint-react/no-string-refs": "error", |
| 47 | + "@eslint-react/no-unsafe-component-will-mount": "warn", |
| 48 | + "@eslint-react/no-unsafe-component-will-receive-props": "warn", |
| 49 | + "@eslint-react/no-unsafe-component-will-update": "warn", |
| 50 | + "@eslint-react/no-unstable-context-value": "warn", |
| 51 | + "@eslint-react/no-unstable-default-props": "warn", |
| 52 | + "@eslint-react/no-unused-class-component-members": "warn", |
| 53 | + "@eslint-react/no-unused-state": "warn", |
| 54 | + "@eslint-react/no-useless-fragment": "warn", |
| 55 | + "@eslint-react/prefer-destructuring-assignment": "warn", |
| 56 | + "@eslint-react/prefer-shorthand-boolean": "warn", |
| 57 | + "@eslint-react/prefer-shorthand-fragment": "warn", |
| 58 | + |
| 59 | + // Part: DOM |
| 60 | + "@eslint-react/dom/no-children-in-void-dom-elements": "warn", |
| 61 | + "@eslint-react/dom/no-dangerously-set-innerhtml": "warn", |
| 62 | + "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error", |
| 63 | + "@eslint-react/dom/no-find-dom-node": "error", |
| 64 | + "@eslint-react/dom/no-missing-button-type": "warn", |
| 65 | + "@eslint-react/dom/no-missing-iframe-sandbox": "warn", |
| 66 | + "@eslint-react/dom/no-namespace": "error", |
| 67 | + "@eslint-react/dom/no-render-return-value": "error", |
| 68 | + "@eslint-react/dom/no-script-url": "warn", |
| 69 | + "@eslint-react/dom/no-unknown-property": "warn", |
| 70 | + "@eslint-react/dom/no-unsafe-iframe-sandbox": "warn", |
| 71 | + "@eslint-react/dom/no-unsafe-target-blank": "warn", |
| 72 | + |
| 73 | + // Part: Web API |
| 74 | + "@eslint-react/web-api/no-leaked-event-listener": "warn", |
| 75 | + "@eslint-react/web-api/no-leaked-interval": "warn", |
| 76 | + "@eslint-react/web-api/no-leaked-resize-observer": "warn", |
| 77 | + "@eslint-react/web-api/no-leaked-timeout": "warn", |
| 78 | + |
| 79 | + // Part: Hooks Extra |
| 80 | + "@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn", |
| 81 | + "@eslint-react/hooks-extra/no-direct-set-state-in-use-layout-effect": "warn", |
| 82 | + "@eslint-react/hooks-extra/no-redundant-custom-hook": "warn", |
| 83 | + "@eslint-react/hooks-extra/no-unnecessary-use-callback": "warn", |
| 84 | + "@eslint-react/hooks-extra/no-unnecessary-use-memo": "warn", |
| 85 | + "@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn", |
| 86 | + |
| 87 | + "@eslint-react/naming-convention/component-name": "warn", |
| 88 | + "@eslint-react/naming-convention/filename": "warn", |
| 89 | + "@eslint-react/naming-convention/filename-extension": "warn", |
| 90 | + "@eslint-react/naming-convention/use-state": "warn", |
| 91 | +} as const satisfies RulePreset; |
| 92 | + |
| 93 | +export const plugins = { |
| 94 | + ...core.plugins, |
| 95 | + ...dom.plugins, |
| 96 | + "@eslint-react/debug": reactDebug, |
| 97 | + "@eslint-react/hooks-extra": reactHooksExtra, |
| 98 | + "@eslint-react/naming-convention": reactNamingConvention, |
| 99 | + "@eslint-react/web-api": reactWebApi, |
| 100 | +}; |
| 101 | + |
| 102 | +export const settings = { |
| 103 | + ...dom.settings, |
| 104 | +}; |
0 commit comments