@ethang/eslint-config 18.0.1 → 18.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/config.react.js +97 -0
  2. package/package.json +5 -1
@@ -0,0 +1,97 @@
1
+ import react from "eslint-plugin-react";
2
+ import reactHooks from "eslint-plugin-react-hooks";
3
+ import tseslint from "typescript-eslint";
4
+
5
+ import { ignores, languageOptions } from "./eslint.config.js";
6
+
7
+ export default tseslint.config({
8
+ files: ["**/*.{jsx,tsx}"],
9
+ ignores,
10
+ languageOptions,
11
+ plugins: {
12
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
13
+ react,
14
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
15
+ "react-hooks": reactHooks,
16
+ },
17
+ rules: {
18
+ "react-hooks/exhaustive-deps": "error",
19
+ "react-hooks/rules-of-hooks": "error",
20
+ "react/boolean-prop-naming": "error",
21
+ "react/button-has-type": "error",
22
+ "react/checked-requires-onchange-or-readonly": "error",
23
+ "react/default-props-match-prop-types": "error",
24
+ "react/destructuring-assignment": "error",
25
+ "react/display-name": "error",
26
+ "react/forbid-component-props": "error",
27
+ "react/function-component-definition": "error",
28
+ "react/hook-use-state": "error",
29
+ "react/iframe-missing-sandbox": "error",
30
+ "react/jsx-boolean-value": "error",
31
+ "react/jsx-curly-brace-presence": "error",
32
+ "react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
33
+ "react/jsx-fragments": "error",
34
+ "react/jsx-handler-names": "error",
35
+ "react/jsx-key": "error",
36
+ "react/jsx-max-depth": "error",
37
+ "react/jsx-no-bind": "error",
38
+ "react/jsx-no-comment-textnodes": "error",
39
+ "react/jsx-no-constructed-context-values": "error",
40
+ "react/jsx-no-duplicate-props": "error",
41
+ "react/jsx-no-leaked-render": "error",
42
+ "react/jsx-no-script-url": "error",
43
+ "react/jsx-no-target-blank": "error",
44
+ "react/jsx-no-undef": "error",
45
+ "react/jsx-no-useless-fragment": "error",
46
+ "react/jsx-pascal-case": "error",
47
+ "react/jsx-props-no-spread-multi": "error",
48
+ "react/jsx-uses-react": "error",
49
+ "react/jsx-uses-vars": "error",
50
+ "react/no-access-state-in-setstate": "error",
51
+ "react/no-adjacent-inline-elements": "error",
52
+ "react/no-array-index-key": "error",
53
+ "react/no-arrow-function-lifecycle": "error",
54
+ "react/no-children-prop": "error",
55
+ "react/no-danger-with-children": "error",
56
+ "react/no-deprecated": "error",
57
+ "react/no-did-mount-set-state": "error",
58
+ "react/no-did-update-set-state": "error",
59
+ "react/no-direct-mutation-state": "error",
60
+ "react/no-find-dom-node": "error",
61
+ "react/no-invalid-html-attribute": "error",
62
+ "react/no-is-mounted": "error",
63
+ "react/no-multi-comp": "error",
64
+ "react/no-namespace": "error",
65
+ "react/no-object-type-as-default-prop": "error",
66
+ "react/no-redundant-should-component-update": "error",
67
+ "react/no-render-return-value": "error",
68
+ "react/no-set-state": "error",
69
+ "react/no-string-refs": "error",
70
+ "react/no-this-in-sfc": "error",
71
+ "react/no-typos": "error",
72
+ "react/no-unescaped-entities": "error",
73
+ "react/no-unknown-property": "error",
74
+ "react/no-unsafe": "error",
75
+ "react/no-unstable-nested-components": "error",
76
+ "react/no-unused-class-component-methods": "error",
77
+ "react/no-unused-prop-types": "error",
78
+ "react/no-unused-state": "error",
79
+ "react/no-will-update-set-state": "error",
80
+ "react/prefer-es6-class": "error",
81
+ "react/prefer-exact-props": "error",
82
+ "react/prefer-read-only-props": "error",
83
+ "react/prefer-stateless-function": "error",
84
+ "react/prop-types": "error",
85
+ "react/require-optimization": "error",
86
+ "react/require-render-return": "error",
87
+ "react/self-closing-comp": "error",
88
+ "react/sort-comp": "error",
89
+ "react/sort-default-props": "error",
90
+ "react/sort-prop-types": "error",
91
+ "react/state-in-constructor": "error",
92
+ "react/static-property-placement": "error",
93
+
94
+ "react/style-prop-object": "error",
95
+ "react/void-dom-elements-no-children": "error",
96
+ },
97
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethang/eslint-config",
3
- "version": "18.0.1",
3
+ "version": "18.0.2",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/eglove/eslint-config-ethang.git"
6
6
  },
@@ -26,6 +26,8 @@
26
26
  "eslint-plugin-n": "^17.10.1",
27
27
  "eslint-plugin-perfectionist": "^3.1.0",
28
28
  "eslint-plugin-prettier": "^5.2.1",
29
+ "eslint-plugin-react": "^7.35.0",
30
+ "eslint-plugin-react-hooks": "^4.6.2",
29
31
  "eslint-plugin-sonarjs": "1.0.4",
30
32
  "eslint-plugin-unicorn": "^55.0.0",
31
33
  "prettier": "^3.3.3",
@@ -43,6 +45,8 @@
43
45
  "eslint-plugin-n": "^17.10.1",
44
46
  "eslint-plugin-perfectionist": "^3.1.0",
45
47
  "eslint-plugin-prettier": "^5.2.1",
48
+ "eslint-plugin-react": "^7.35.0",
49
+ "eslint-plugin-react-hooks": "^4.6.2",
46
50
  "eslint-plugin-sonarjs": "1.0.4",
47
51
  "eslint-plugin-unicorn": "^55.0.0",
48
52
  "prettier": "^3.3.3",