@ethang/eslint-config 24.0.1 → 24.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 (75) hide show
  1. package/build.ts +48 -0
  2. package/dist/config.html.js +2 -0
  3. package/dist/config.html.js.map +1 -0
  4. package/dist/eslint.config.d.ts +4 -0
  5. package/dist/eslint.config.js +2 -0
  6. package/dist/package.json +67 -0
  7. package/eslint.config.js +28 -2
  8. package/package.json +1 -1
  9. package/src/README.md +132 -0
  10. package/src/build/create-config-file.ts +70 -0
  11. package/src/build/create-config.ts +98 -0
  12. package/src/build/get-react-version.ts +19 -0
  13. package/src/build/list-utilities.ts +137 -0
  14. package/src/build/rule-list.ts +283 -0
  15. package/src/build/update-readme.ts +259 -0
  16. package/src/build/update-rules.ts +173 -0
  17. package/src/config.angular.js +122 -0
  18. package/src/config.astro.js +69 -0
  19. package/src/config.html.js +73 -0
  20. package/src/config.react.js +111 -0
  21. package/src/config.solid.js +34 -0
  22. package/src/config.storybook.js +31 -0
  23. package/src/config.tailwind.js +28 -0
  24. package/src/constants.js +16 -0
  25. package/src/eslint.config.js +1075 -0
  26. package/src/eslint.html.js +73 -0
  27. package/src/setup/a11y.ts +19 -0
  28. package/src/setup/angular.ts +36 -0
  29. package/src/setup/astro.ts +14 -0
  30. package/src/setup/compat.ts +13 -0
  31. package/src/setup/cspell.ts +100 -0
  32. package/src/setup/css.ts +15 -0
  33. package/src/setup/eslint.ts +250 -0
  34. package/src/setup/gen-rules.ts +85 -0
  35. package/src/setup/html.ts +17 -0
  36. package/src/setup/json.ts +17 -0
  37. package/src/setup/lodash.ts +59 -0
  38. package/src/setup/markdown.ts +16 -0
  39. package/src/setup/perfectionist.ts +49 -0
  40. package/src/setup/react.ts +37 -0
  41. package/src/setup/solid.ts +21 -0
  42. package/src/setup/sonar.ts +40 -0
  43. package/src/setup/storybook.ts +10 -0
  44. package/src/setup/tailwind.ts +12 -0
  45. package/src/setup/tanstack-query.ts +8 -0
  46. package/src/setup/tanstack-router.ts +8 -0
  47. package/src/setup/typescript-eslint.ts +114 -0
  48. package/src/setup/unicorn.ts +38 -0
  49. package/src/tsconfig.json +3 -0
  50. package/tsconfig.json +3 -0
  51. /package/{README.md → dist/README.md} +0 -0
  52. /package/{chunk-WK3YS7OG.js → dist/chunk-WK3YS7OG.js} +0 -0
  53. /package/{chunk-WK3YS7OG.js.map → dist/chunk-WK3YS7OG.js.map} +0 -0
  54. /package/{config.angular.d.ts → dist/config.angular.d.ts} +0 -0
  55. /package/{config.angular.js → dist/config.angular.js} +0 -0
  56. /package/{config.angular.js.map → dist/config.angular.js.map} +0 -0
  57. /package/{config.astro.d.ts → dist/config.astro.d.ts} +0 -0
  58. /package/{config.astro.js → dist/config.astro.js} +0 -0
  59. /package/{config.astro.js.map → dist/config.astro.js.map} +0 -0
  60. /package/{config.react.d.ts → dist/config.html.d.ts} +0 -0
  61. /package/{config.solid.d.ts → dist/config.react.d.ts} +0 -0
  62. /package/{config.react.js → dist/config.react.js} +0 -0
  63. /package/{config.react.js.map → dist/config.react.js.map} +0 -0
  64. /package/{config.storybook.d.ts → dist/config.solid.d.ts} +0 -0
  65. /package/{config.solid.js → dist/config.solid.js} +0 -0
  66. /package/{config.solid.js.map → dist/config.solid.js.map} +0 -0
  67. /package/{eslint.config.d.ts → dist/config.storybook.d.ts} +0 -0
  68. /package/{config.storybook.js → dist/config.storybook.js} +0 -0
  69. /package/{config.storybook.js.map → dist/config.storybook.js.map} +0 -0
  70. /package/{config.tailwind.d.ts → dist/config.tailwind.d.ts} +0 -0
  71. /package/{config.tailwind.js → dist/config.tailwind.js} +0 -0
  72. /package/{config.tailwind.js.map → dist/config.tailwind.js.map} +0 -0
  73. /package/{constants.js → dist/constants.js} +0 -0
  74. /package/{constants.js.map → dist/constants.js.map} +0 -0
  75. /package/{eslint.config.js.map → dist/eslint.config.js.map} +0 -0
@@ -0,0 +1,73 @@
1
+ import html from "@html-eslint/eslint-plugin";
2
+ // @ts-nocheck
3
+ import { defineConfig } from "eslint/config";
4
+
5
+ import { ignores, languageOptions } from "./constants.js";
6
+
7
+ export default defineConfig({
8
+ files: ["**/*.html"],
9
+ ignores,
10
+ language: "html/html",
11
+ languageOptions,
12
+ plugins: {
13
+ html,
14
+ },
15
+ rules: {
16
+ "html/attrs-newline": "off",
17
+ "html/element-newline": "off",
18
+ "html/id-naming-convention": "error",
19
+ "html/indent": "off",
20
+ "html/lowercase": "error",
21
+ "html/max-element-depth": "error",
22
+ "html/no-abstract-roles": "error",
23
+ "html/no-accesskey-attrs": "error",
24
+ "html/no-aria-hidden-body": "error",
25
+ "html/no-aria-hidden-on-focusable": "error",
26
+ "html/no-duplicate-attrs": "error",
27
+ "html/no-duplicate-class": "error",
28
+ "html/no-duplicate-id": "error",
29
+ "html/no-duplicate-in-head": "error",
30
+ "html/no-empty-headings": "error",
31
+ "html/no-extra-spacing-attrs": "off",
32
+ "html/no-extra-spacing-text": "error",
33
+ "html/no-heading-inside-button": "error",
34
+ "html/no-ineffective-attrs": "error",
35
+ "html/no-inline-styles": "error",
36
+ "html/no-invalid-entity": "error",
37
+ "html/no-invalid-role": "error",
38
+ "html/no-multiple-empty-lines": "error",
39
+ "html/no-multiple-h1": "error",
40
+ "html/no-nested-interactive": "error",
41
+ "html/no-non-scalable-viewport": "error",
42
+ "html/no-obsolete-tags": "error",
43
+ "html/no-positive-tabindex": "error",
44
+ "html/no-restricted-attr-values": "error",
45
+ "html/no-restricted-attrs": "error",
46
+ "html/no-restricted-tags": "error",
47
+ "html/no-script-style-type": "error",
48
+ "html/no-skip-heading-levels": "error",
49
+ "html/no-target-blank": "error",
50
+ "html/no-trailing-spaces": "error",
51
+ "html/no-whitespace-only-children": "error",
52
+ "html/prefer-https": "error",
53
+ "html/quotes": "error",
54
+ "html/require-attrs": "error",
55
+ "html/require-button-type": "error",
56
+ "html/require-closing-tags": "off",
57
+ "html/require-doctype": "error",
58
+ "html/require-explicit-size": "error",
59
+ "html/require-form-method": "error",
60
+ "html/require-frame-title": "error",
61
+ "html/require-img-alt": "error",
62
+ "html/require-input-label": "error",
63
+ "html/require-lang": "error",
64
+ "html/require-li-container": "error",
65
+ "html/require-meta-charset": "error",
66
+ "html/require-meta-description": "error",
67
+ "html/require-meta-viewport": "error",
68
+ "html/require-open-graph-protocol": "error",
69
+ "html/require-title": "error",
70
+ "html/sort-attrs": "error",
71
+ "html/use-baseline": "error",
72
+ },
73
+ });
@@ -0,0 +1,111 @@
1
+ // @ts-nocheck
2
+ import { defineConfig } from "eslint/config";
3
+ import { ignores, languageOptions } from "./constants.js";
4
+ import react from "@eslint-react/eslint-plugin";
5
+ import reactHooks from "eslint-plugin-react-hooks";
6
+
7
+ export default defineConfig({
8
+ files: ["**/*.{jsx,tsx}"],
9
+ ignores,
10
+ languageOptions,
11
+ settings: {
12
+ react: { version: "19.2.3" },
13
+ },
14
+ plugins: {
15
+ react: react,
16
+ "react-hooks": reactHooks,
17
+ },
18
+ rules: {
19
+ "react/jsx-dollar": "error",
20
+ "react/jsx-key-before-spread": "error",
21
+ "react/jsx-no-comment-textnodes": "error",
22
+ "react/jsx-no-duplicate-props": "error",
23
+ "react/jsx-no-iife": "error",
24
+ "react/jsx-no-undef": "error",
25
+ "react/jsx-shorthand-boolean": "error",
26
+ "react/jsx-shorthand-fragment": "error",
27
+ "react/jsx-uses-react": "error",
28
+ "react/jsx-uses-vars": "error",
29
+ "react/no-access-state-in-setstate": "error",
30
+ "react/no-array-index-key": "error",
31
+ "react/no-children-count": "error",
32
+ "react/no-children-for-each": "error",
33
+ "react/no-children-map": "error",
34
+ "react/no-children-only": "error",
35
+ "react/no-children-prop": "error",
36
+ "react/no-children-to-array": "error",
37
+ "react/no-class-component": "error",
38
+ "react/no-clone-element": "error",
39
+ "react/no-component-will-mount": "error",
40
+ "react/no-component-will-receive-props": "error",
41
+ "react/no-component-will-update": "error",
42
+ "react/no-context-provider": "error",
43
+ "react/no-create-ref": "error",
44
+ "react/no-default-props": "error",
45
+ "react/no-direct-mutation-state": "error",
46
+ "react/no-duplicate-key": "error",
47
+ "react/no-forward-ref": "error",
48
+ "react/no-implicit-key": "error",
49
+ "react/no-leaked-conditional-rendering": "error",
50
+ "react/no-missing-component-display-name": "error",
51
+ "react/no-missing-context-display-name": "error",
52
+ "react/no-missing-key": "error",
53
+ "react/no-misused-capture-owner-stack": "error",
54
+ "react/no-nested-component-definitions": "error",
55
+ "react/no-nested-lazy-component-declarations": "error",
56
+ "react/no-prop-types": "error",
57
+ "react/no-redundant-should-component-update": "error",
58
+ "react/no-set-state-in-component-did-mount": "error",
59
+ "react/no-set-state-in-component-did-update": "error",
60
+ "react/no-set-state-in-component-will-update": "error",
61
+ "react/no-string-refs": "error",
62
+ "react/no-unnecessary-key": "error",
63
+ "react/no-unnecessary-use-callback": "error",
64
+ "react/no-unnecessary-use-memo": "error",
65
+ "react/no-unnecessary-use-prefix": "error",
66
+ "react/no-unsafe-component-will-mount": "error",
67
+ "react/no-unsafe-component-will-receive-props": "error",
68
+ "react/no-unsafe-component-will-update": "error",
69
+ "react/no-unstable-context-value": "error",
70
+ "react/no-unstable-default-props": "error",
71
+ "react/no-unused-class-component-members": "error",
72
+ "react/no-unused-props": "error",
73
+ "react/no-unused-state": "error",
74
+ "react/no-use-context": "error",
75
+ "react/no-useless-forward-ref": "error",
76
+ "react/no-useless-fragment": "error",
77
+ "react/prefer-destructuring-assignment": "error",
78
+ "react/prefer-namespace-import": "error",
79
+ "react/prefer-read-only-props": "error",
80
+ "react/prefer-use-state-lazy-initialization": "error",
81
+ "react-hooks/automatic-effect-dependencies": "error",
82
+ "react-hooks/capitalized-calls": "error",
83
+ "react-hooks/component-hook-factories": "error",
84
+ "react-hooks/config": "error",
85
+ "react-hooks/error-boundaries": "error",
86
+ "react-hooks/exhaustive-deps": "error",
87
+ "react-hooks/fbt": "error",
88
+ "react-hooks/fire": "error",
89
+ "react-hooks/gating": "error",
90
+ "react-hooks/globals": "error",
91
+ "react-hooks/hooks": "error",
92
+ "react-hooks/immutability": "error",
93
+ "react-hooks/incompatible-library": "error",
94
+ "react-hooks/invariant": "error",
95
+ "react-hooks/memoized-effect-dependencies": "error",
96
+ "react-hooks/no-deriving-state-in-effects": "error",
97
+ "react-hooks/preserve-manual-memoization": "error",
98
+ "react-hooks/purity": "error",
99
+ "react-hooks/refs": "error",
100
+ "react-hooks/rule-suppression": "error",
101
+ "react-hooks/rules-of-hooks": "error",
102
+ "react-hooks/set-state-in-effect": "error",
103
+ "react-hooks/set-state-in-render": "error",
104
+ "react-hooks/static-components": "error",
105
+ "react-hooks/syntax": "error",
106
+ "react-hooks/todo": "error",
107
+ "react-hooks/unsupported-syntax": "error",
108
+ "react-hooks/use-memo": "error",
109
+ "react-hooks/void-use-memo": "error",
110
+ },
111
+ });
@@ -0,0 +1,34 @@
1
+ // @ts-nocheck
2
+ import { defineConfig } from "eslint/config";
3
+ import { ignores, languageOptions } from "./constants.js";
4
+ import solid from "eslint-plugin-solid";
5
+
6
+ export default defineConfig({
7
+ files: ["**/*.{jsx,tsx}"],
8
+ ignores,
9
+ languageOptions,
10
+ plugins: {
11
+ solid: solid,
12
+ },
13
+ rules: {
14
+ "solid/components-return-once": "error",
15
+ "solid/event-handlers": "error",
16
+ "solid/imports": "error",
17
+ "solid/jsx-no-duplicate-props": "error",
18
+ "solid/jsx-no-script-url": "error",
19
+ "solid/jsx-no-undef": "error",
20
+ "solid/jsx-uses-vars": "error",
21
+ "solid/no-array-handlers": "error",
22
+ "solid/no-destructure": "error",
23
+ "solid/no-innerhtml": "error",
24
+ "solid/no-proxy-apis": "off",
25
+ "solid/no-react-deps": "error",
26
+ "solid/no-react-specific-props": "error",
27
+ "solid/no-unknown-namespaces": "error",
28
+ "solid/prefer-for": "error",
29
+ "solid/prefer-show": "error",
30
+ "solid/reactivity": "error",
31
+ "solid/self-closing-comp": "error",
32
+ "solid/style-prop": "error",
33
+ },
34
+ });
@@ -0,0 +1,31 @@
1
+ // @ts-nocheck
2
+ import { defineConfig } from "eslint/config";
3
+ import { ignores, languageOptions } from "./constants.js";
4
+ import storybook from "eslint-plugin-storybook";
5
+
6
+ export default defineConfig({
7
+ files: ["**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)"],
8
+ ignores,
9
+ languageOptions,
10
+ plugins: {
11
+ storybook: storybook,
12
+ },
13
+ rules: {
14
+ "storybook/await-interactions": "error",
15
+ "storybook/context-in-play-function": "error",
16
+ "storybook/csf-component": "error",
17
+ "storybook/default-exports": "error",
18
+ "storybook/hierarchy-separator": "error",
19
+ "storybook/meta-inline-properties": "error",
20
+ "storybook/meta-satisfies-type": "error",
21
+ "storybook/no-redundant-story-name": "error",
22
+ "storybook/no-renderer-packages": "error",
23
+ "storybook/no-stories-of": "error",
24
+ "storybook/no-title-property-in-meta": "error",
25
+ "storybook/no-uninstalled-addons": "error",
26
+ "storybook/prefer-pascal-case": "error",
27
+ "storybook/story-exports": "error",
28
+ "storybook/use-storybook-expect": "error",
29
+ "storybook/use-storybook-testing-library": "error",
30
+ },
31
+ });
@@ -0,0 +1,28 @@
1
+ // @ts-nocheck
2
+ import { defineConfig } from "eslint/config";
3
+ import { ignores, languageOptions } from "./constants.js";
4
+ import tailwind from "eslint-plugin-tailwindcss";
5
+
6
+ const config = (/** @type {string} */ pathToConfig) => {
7
+ return defineConfig({
8
+ files: ["**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts}"],
9
+ ignores,
10
+ languageOptions,
11
+ plugins: {
12
+ tailwind: tailwind,
13
+ },
14
+ rules: {
15
+ "tailwind/classnames-order": "error",
16
+ "tailwind/enforces-negative-arbitrary-values": "error",
17
+ "tailwind/enforces-shorthand": "error",
18
+ "tailwind/migration-from-tailwind-2": "error",
19
+ "tailwind/no-arbitrary-value": "off",
20
+ "tailwind/no-contradicting-classname": "error",
21
+ "tailwind/no-custom-classname": "off",
22
+ "tailwind/no-unnecessary-arbitrary-value": "error",
23
+ },
24
+ settings: { tailwindcss: { config: pathToConfig } },
25
+ });
26
+ };
27
+
28
+ export default config;
@@ -0,0 +1,16 @@
1
+ import angularTemplateParser from "@angular-eslint/template-parser";
2
+ import { parser } from "typescript-eslint";
3
+
4
+ export const ignores = ["eslint.config.js", "node_modules", "dist"];
5
+
6
+ export const languageOptions = {
7
+ parser,
8
+ parserOptions: {
9
+ project: true,
10
+ tsconfigRootDir: import.meta.dirname,
11
+ },
12
+ };
13
+
14
+ export const angularLanguageOptions = {
15
+ parser: angularTemplateParser,
16
+ };