@ethang/eslint-config 18.0.0 → 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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [View Config](https://eslint-config-ethang.pages.dev/rules)
4
4
 
5
- * 468 errored rules.
5
+ * 469 errored rules.
6
6
  * 142 rules from vanilla EsLint
7
7
  * 113 rules from [sindresorhus/eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)
8
8
  * 104 rules from [@typescript/eslint](https://github.com/typescript-eslint/typescript-eslint)
@@ -11,14 +11,14 @@
11
11
  * 20 rules from [eslint-plugin-n](https://github.com/eslint-community/eslint-plugin-n/tree/67bbfdf3c6862dcbfe455a4afbd83fa60f9d1ea4)
12
12
  * 19 rules from [eslint-plugin-perfectionist](https://github.com/azat-io/eslint-plugin-perfectionist)
13
13
  * 3 rules from [@tanstack/eslint-plugin-query](https://tanstack.com/query/latest/docs/eslint/eslint-plugin-query)
14
- * Includes Prettier built in (do NOT use this with a separate Prettier config.)
14
+ * Includes Prettier built-in (do NOT use this with a separate Prettier config.)
15
15
 
16
16
  # Add Even More!
17
- * 51 rules for **Astro**.
18
- * install [@ethang/eslint-config-astro](https://github.com/eglove/eslint-config-ethang-astro)
17
+ * 51 rules for **Astro**
18
+ * pnpm i -D [@ethang/eslint-config-astro](https://github.com/eglove/eslint-config-ethang-astro)
19
19
  * 51 rules from [eslint-plugin-astro](https://github.com/ota-meshi/eslint-plugin-astro)
20
- * 77 rules for **React**.
21
- * install [@ethang/eslint-config-react](https://github.com/eglove/eslint-config-ethang-react)
20
+ * 77 rules for **React**
21
+ * pnpm i -D [@ethang/eslint-config-react](https://github.com/eglove/eslint-config-ethang-react)
22
22
  * 75 rules from [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react)
23
23
  * 2 rules from [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks)
24
24
 
@@ -0,0 +1,64 @@
1
+ import astro from "eslint-plugin-astro";
2
+ import tseslint from "typescript-eslint";
3
+
4
+ import { ignores, languageOptions } from "./eslint.config.js";
5
+
6
+ export default tseslint.config({
7
+ files: ["**/*.{astro}"],
8
+ ignores,
9
+ languageOptions,
10
+ plugins: { astro },
11
+ rules: {
12
+ "astro/jsx-a11y/alt-text": "error",
13
+ "astro/jsx-a11y/anchor-ambiguous-text": "error",
14
+ "astro/jsx-a11y/anchor-has-content": "error",
15
+ "astro/jsx-a11y/anchor-is-valid": "error",
16
+ "astro/jsx-a11y/aria-activedescendant-has-tabindex": "error",
17
+ "astro/jsx-a11y/aria-props": "error",
18
+ "astro/jsx-a11y/aria-proptypes": "error",
19
+ "astro/jsx-a11y/aria-role": "error",
20
+ "astro/jsx-a11y/aria-unsupported-elements": "error",
21
+ "astro/jsx-a11y/autocomplete-valid": "error",
22
+ "astro/jsx-a11y/click-events-have-key-events": "error",
23
+ "astro/jsx-a11y/control-has-associated-label": "error",
24
+ "astro/jsx-a11y/heading-has-content": "error",
25
+ "astro/jsx-a11y/html-has-lang": "error",
26
+ "astro/jsx-a11y/iframe-has-title": "error",
27
+ "astro/jsx-a11y/img-redundant-alt": "error",
28
+ "astro/jsx-a11y/interactive-supports-focus": "error",
29
+ "astro/jsx-a11y/label-has-associated-control": "error",
30
+ "astro/jsx-a11y/lang": "error",
31
+ "astro/jsx-a11y/media-has-caption": "error",
32
+ "astro/jsx-a11y/mouse-events-have-key-events": "error",
33
+ "astro/jsx-a11y/no-access-key": "error",
34
+ "astro/jsx-a11y/no-aria-hidden-on-focusable": "error",
35
+ "astro/jsx-a11y/no-autofocus": "error",
36
+ "astro/jsx-a11y/no-distracting-elements": "error",
37
+ "astro/jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
38
+ "astro/jsx-a11y/no-noninteractive-element-interactions": "error",
39
+ "astro/jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
40
+ "astro/jsx-a11y/no-noninteractive-tabindex": "error",
41
+ "astro/jsx-a11y/no-redundant-roles": "error",
42
+ "astro/jsx-a11y/no-static-element-interactions": "error",
43
+ "astro/jsx-a11y/prefer-tag-over-role": "error",
44
+ "astro/jsx-a11y/role-has-required-aria-props": "error",
45
+ "astro/jsx-a11y/role-supports-aria-props": "error",
46
+ "astro/jsx-a11y/scope": "error",
47
+ "astro/jsx-a11y/tabindex-no-positive": "error",
48
+ "astro/missing-client-only-directive-value": "error",
49
+ "astro/no-conflict-set-directives": "error",
50
+ "astro/no-deprecated-astro-canonicalurl": "error",
51
+ "astro/no-deprecated-astro-fetchcontent": "error",
52
+ "astro/no-deprecated-astro-resolve": "error",
53
+ "astro/no-deprecated-getentrybyslug": "error",
54
+ "astro/no-exports-from-components": "error",
55
+ "astro/no-set-text-directive": "error",
56
+ "astro/no-unused-css-selector": "error",
57
+ "astro/no-unused-define-vars-in-style": "error",
58
+ "astro/prefer-class-list-directive": "error",
59
+ "astro/prefer-object-class-list": "error",
60
+ "astro/prefer-split-class-list": "error",
61
+ "astro/semi": "error",
62
+ "astro/valid-compile": "error",
63
+ },
64
+ });
@@ -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/eslint.config.js CHANGED
@@ -9,7 +9,7 @@ import sonar from "eslint-plugin-sonarjs";
9
9
  import tanstack from "@tanstack/eslint-plugin-query";
10
10
  import perfectionist from "eslint-plugin-perfectionist";
11
11
 
12
- const languageOptions = {
12
+ export const languageOptions = {
13
13
  parser,
14
14
  parserOptions: {
15
15
  project: true,
@@ -17,7 +17,7 @@ const languageOptions = {
17
17
  },
18
18
  };
19
19
 
20
- const ignores = ["eslint.config.js", "node_modules", "dist"];
20
+ export const ignores = ["eslint.config.js", "node_modules", "dist"];
21
21
 
22
22
  export default tseslint.config(eslintPluginPrettier, {
23
23
  files: ["**/*.{js,ts,mjs,jsx,tsx}"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethang/eslint-config",
3
- "version": "18.0.0",
3
+ "version": "18.0.2",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/eglove/eslint-config-ethang.git"
6
6
  },
@@ -21,10 +21,13 @@
21
21
  "@typescript-eslint/parser": "^8.0.0",
22
22
  "eslint": "^9.8.0",
23
23
  "eslint-config-prettier": "^9.1.0",
24
+ "eslint-plugin-astro": "^1.2.3",
24
25
  "eslint-plugin-jsx-a11y": "^6.9.0",
25
26
  "eslint-plugin-n": "^17.10.1",
26
27
  "eslint-plugin-perfectionist": "^3.1.0",
27
28
  "eslint-plugin-prettier": "^5.2.1",
29
+ "eslint-plugin-react": "^7.35.0",
30
+ "eslint-plugin-react-hooks": "^4.6.2",
28
31
  "eslint-plugin-sonarjs": "1.0.4",
29
32
  "eslint-plugin-unicorn": "^55.0.0",
30
33
  "prettier": "^3.3.3",
@@ -37,10 +40,13 @@
37
40
  "@typescript-eslint/parser": "^8.0.0",
38
41
  "eslint": "^9.8.0",
39
42
  "eslint-config-prettier": "^9.1.0",
43
+ "eslint-plugin-astro": "^1.2.3",
40
44
  "eslint-plugin-jsx-a11y": "^6.9.0",
41
45
  "eslint-plugin-n": "^17.10.1",
42
46
  "eslint-plugin-perfectionist": "^3.1.0",
43
47
  "eslint-plugin-prettier": "^5.2.1",
48
+ "eslint-plugin-react": "^7.35.0",
49
+ "eslint-plugin-react-hooks": "^4.6.2",
44
50
  "eslint-plugin-sonarjs": "1.0.4",
45
51
  "eslint-plugin-unicorn": "^55.0.0",
46
52
  "prettier": "^3.3.3",