@shayanthenerd/eslint-config 0.32.0 → 0.34.0

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 (37) hide show
  1. package/README.md +65 -40
  2. package/dist/configs/astro.mjs +5 -1
  3. package/dist/configs/css.mjs +3 -3
  4. package/dist/configs/packageJson.mjs +1 -1
  5. package/dist/configs/react.mjs +2 -2
  6. package/dist/configs/tailwind.mjs +7 -1
  7. package/dist/configs/typescript.mjs +4 -6
  8. package/dist/helpers/ignores/defaultIgnorePatterns.mjs +1 -6
  9. package/dist/helpers/options/defaultOptions.mjs +13 -3
  10. package/dist/helpers/options/enableDetectedConfigs.mjs +20 -8
  11. package/dist/index.d.mts +1 -0
  12. package/dist/rules/astro.mjs +61 -54
  13. package/dist/rules/baseline.mjs +1 -1
  14. package/dist/rules/css.mjs +30 -10
  15. package/dist/rules/html.mjs +11 -3
  16. package/dist/rules/importX.mjs +2 -2
  17. package/dist/rules/javascript.mjs +6 -5
  18. package/dist/rules/markdown.mjs +7 -1
  19. package/dist/rules/next.mjs +2 -0
  20. package/dist/rules/node.mjs +1 -1
  21. package/dist/rules/packageJson.mjs +166 -153
  22. package/dist/rules/perfectionist.mjs +41 -11
  23. package/dist/rules/playwright.mjs +10 -0
  24. package/dist/rules/react.mjs +56 -54
  25. package/dist/rules/stylistic.mjs +1 -1
  26. package/dist/rules/tanstack.mjs +1 -1
  27. package/dist/rules/typescript.mjs +3 -2
  28. package/dist/rules/unicorn.mjs +38 -7
  29. package/dist/rules/vue.mjs +38 -41
  30. package/dist/rules/zod.mjs +2 -0
  31. package/dist/types/eslint-schema.d.mts +1086 -669
  32. package/dist/types/index.d.mts +44 -9
  33. package/dist/types/options/baseline.d.mts +24 -3
  34. package/dist/types/options/react.d.mts +9 -9
  35. package/dist/types/options/typescript.d.mts +3 -3
  36. package/dist/types/options/vue.d.mts +1 -1
  37. package/package.json +39 -37
@@ -2,9 +2,11 @@
2
2
  function getPlaywrightRules(options) {
3
3
  const { maxNestedDescribe } = options.configs.test;
4
4
  return {
5
+ "playwright/consistent-spacing-between-blocks": "warn",
5
6
  "playwright/expect-expect": "error",
6
7
  "playwright/max-nested-describe": ["warn", { max: maxNestedDescribe }],
7
8
  "playwright/missing-playwright-await": ["error", { includePageLocatorMethods: true }],
9
+ "playwright/no-action-timeout": "warn",
8
10
  "playwright/no-commented-out-tests": "error",
9
11
  "playwright/no-conditional-expect": "error",
10
12
  "playwright/no-conditional-in-test": "error",
@@ -12,24 +14,31 @@ function getPlaywrightRules(options) {
12
14
  "playwright/no-duplicate-slow": "error",
13
15
  "playwright/no-element-handle": "warn",
14
16
  "playwright/no-eval": "error",
17
+ "playwright/no-export": "error",
15
18
  "playwright/no-focused-test": "error",
16
19
  "playwright/no-force-option": "warn",
17
20
  "playwright/no-get-by-title": "warn",
21
+ "playwright/no-identical-title": "error",
22
+ "playwright/no-magic-timeouts": "warn",
18
23
  "playwright/no-nested-step": "warn",
19
24
  "playwright/no-networkidle": "error",
25
+ "playwright/no-nth-methods": "warn",
20
26
  "playwright/no-page-pause": "error",
21
27
  "playwright/no-raw-locators": "warn",
22
28
  "playwright/no-skipped-test": "error",
23
29
  "playwright/no-slowed-test": "warn",
24
30
  "playwright/no-standalone-expect": "error",
31
+ "playwright/no-test-return-statement": "error",
25
32
  "playwright/no-unnecessary-assertions": "error",
26
33
  "playwright/no-unsafe-references": "error",
27
34
  "playwright/no-unused-locators": "warn",
28
35
  "playwright/no-useless-await": "warn",
29
36
  "playwright/no-useless-not": "warn",
37
+ "playwright/no-wait-for-navigation": "error",
30
38
  "playwright/no-wait-for-selector": "warn",
31
39
  "playwright/no-wait-for-timeout": "error",
32
40
  "playwright/prefer-comparison-matcher": "warn",
41
+ "playwright/prefer-ending-with-an-expect": "warn",
33
42
  "playwright/prefer-equality-matcher": "warn",
34
43
  "playwright/prefer-hooks-in-order": "warn",
35
44
  "playwright/prefer-hooks-on-top": "warn",
@@ -42,6 +51,7 @@ function getPlaywrightRules(options) {
42
51
  "playwright/prefer-to-have-count": "warn",
43
52
  "playwright/prefer-to-have-length": "warn",
44
53
  "playwright/prefer-web-first-assertions": "warn",
54
+ "playwright/require-annotation-reason": "warn",
45
55
  "playwright/require-hook": "error",
46
56
  "playwright/require-to-pass-timeout": "error",
47
57
  "playwright/require-to-throw-message": "error",
@@ -14,50 +14,10 @@ const commonCallees = [
14
14
  "ctl"
15
15
  ];
16
16
  function getReactRules(options) {
17
- const { react, unicorn, tailwind, baseline, stylistic } = options.configs;
17
+ const { react, tailwind, baseline, stylistic, typescript } = options.configs;
18
18
  const { imageComponents: userImageComponents, anchorComponents: userAnchorComponents, headingComponents: userHeadingComponents } = isEnabled(react) && isEnabled(react.accessibility) ? react.accessibility : defaultOptions.configs.react.accessibility;
19
- const jsxA11yRules = {
20
- "jsx-a11y/alt-text": ["error", { img: userImageComponents }],
21
- "jsx-a11y/anchor-ambiguous-text": "warn",
22
- "jsx-a11y/anchor-has-content": ["error", { components: userAnchorComponents }],
23
- "jsx-a11y/anchor-is-valid": ["error", {
24
- specialLink: ["to"],
25
- components: userAnchorComponents
26
- }],
27
- "jsx-a11y/aria-activedescendant-has-tabindex": "error",
28
- "jsx-a11y/aria-props": "error",
29
- "jsx-a11y/aria-proptypes": "error",
30
- "jsx-a11y/aria-role": "error",
31
- "jsx-a11y/aria-unsupported-elements": "error",
32
- "jsx-a11y/autocomplete-valid": "error",
33
- "jsx-a11y/click-events-have-key-events": "error",
34
- "jsx-a11y/control-has-associated-label": "error",
35
- "jsx-a11y/heading-has-content": ["error", { components: userHeadingComponents }],
36
- "jsx-a11y/html-has-lang": "error",
37
- "jsx-a11y/iframe-has-title": "error",
38
- "jsx-a11y/img-redundant-alt": ["error", { components: userImageComponents }],
39
- "jsx-a11y/interactive-supports-focus": "error",
40
- "jsx-a11y/label-has-associated-control": "error",
41
- "jsx-a11y/lang": "error",
42
- "jsx-a11y/media-has-caption": "error",
43
- "jsx-a11y/mouse-events-have-key-events": "error",
44
- "jsx-a11y/no-access-key": "warn",
45
- "jsx-a11y/no-aria-hidden-on-focusable": "error",
46
- "jsx-a11y/no-autofocus": "warn",
47
- "jsx-a11y/no-distracting-elements": "warn",
48
- "jsx-a11y/no-interactive-element-to-noninteractive-role": "error",
49
- "jsx-a11y/no-noninteractive-element-interactions": "error",
50
- "jsx-a11y/no-noninteractive-element-to-interactive-role": "error",
51
- "jsx-a11y/no-noninteractive-tabindex": "error",
52
- "jsx-a11y/no-redundant-roles": "warn",
53
- "jsx-a11y/no-static-element-interactions": "warn",
54
- "jsx-a11y/prefer-tag-over-role": "warn",
55
- "jsx-a11y/role-has-required-aria-props": "warn",
56
- "jsx-a11y/role-supports-aria-props": "warn",
57
- "jsx-a11y/scope": "error",
58
- "jsx-a11y/tabindex-no-positive": "error"
59
- };
60
- const reactAndHtmlReactRules = {
19
+ const isTypescriptEnabled = isEnabled(typescript);
20
+ const reactRules = {
61
21
  /*** @eslint/react ***/
62
22
  "@eslint-react/error-boundaries": "error",
63
23
  "@eslint-react/exhaustive-deps": "error",
@@ -80,10 +40,10 @@ function getReactRules(options) {
80
40
  "@eslint-react/no-direct-mutation-state": "error",
81
41
  "@eslint-react/no-duplicate-key": "error",
82
42
  "@eslint-react/no-forward-ref": "warn",
83
- "@eslint-react/no-implicit-children": "warn",
84
- "@eslint-react/no-implicit-key": "warn",
85
- "@eslint-react/no-implicit-ref": "warn",
86
- "@eslint-react/no-leaked-conditional-rendering": "error",
43
+ "@eslint-react/no-implicit-children": isTypescriptEnabled ? "warn" : "off",
44
+ "@eslint-react/no-implicit-key": isTypescriptEnabled ? "warn" : "off",
45
+ "@eslint-react/no-implicit-ref": isTypescriptEnabled ? "warn" : "off",
46
+ "@eslint-react/no-leaked-conditional-rendering": isTypescriptEnabled ? "error" : "off",
87
47
  "@eslint-react/no-missing-component-display-name": "warn",
88
48
  "@eslint-react/no-missing-context-display-name": "warn",
89
49
  "@eslint-react/no-missing-key": "error",
@@ -100,7 +60,7 @@ function getReactRules(options) {
100
60
  "@eslint-react/no-unstable-context-value": "error",
101
61
  "@eslint-react/no-unstable-default-props": "error",
102
62
  "@eslint-react/no-unused-class-component-members": "error",
103
- "@eslint-react/no-unused-props": "error",
63
+ "@eslint-react/no-unused-props": isTypescriptEnabled ? "error" : "off",
104
64
  "@eslint-react/no-unused-state": "error",
105
65
  "@eslint-react/no-use-context": "warn",
106
66
  "@eslint-react/purity": "error",
@@ -116,6 +76,8 @@ function getReactRules(options) {
116
76
  "@eslint-react/jsx-no-children-prop-with-children": "error",
117
77
  "@eslint-react/jsx-no-comment-textnodes": "error",
118
78
  "@eslint-react/jsx-no-key-after-spread": "warn",
79
+ "@eslint-react/jsx-no-leaked-dollar": "warn",
80
+ "@eslint-react/jsx-no-leaked-semicolon": "warn",
119
81
  "@eslint-react/jsx-no-namespace": "error",
120
82
  "@eslint-react/jsx-no-useless-fragment": "warn",
121
83
  "@eslint-react/rsc-function-definition": "error",
@@ -153,13 +115,53 @@ function getReactRules(options) {
153
115
  "@html-eslint/react/classname-spacing": isEnabled(stylistic) ? ["warn", { callees: commonCallees }] : "off",
154
116
  "@html-eslint/react/no-duplicate-classname": ["warn", { callees: commonCallees }]
155
117
  };
156
- if (isEnabled(tailwind)) reactAndHtmlReactRules["better-tailwindcss/no-duplicate-classes"] = "off";
157
- if (isEnabled(unicorn)) reactAndHtmlReactRules["unicorn/no-invalid-file-input-accept"] = "error";
158
- const isReactAccessibilityEnabled = isEnabled(react) && isEnabled(react.accessibility);
159
- return {
160
- ...reactAndHtmlReactRules,
161
- ...isReactAccessibilityEnabled && jsxA11yRules
118
+ const jsxA11yXRules = {
119
+ "jsx-a11y-x/alt-text": ["error", { img: userImageComponents }],
120
+ "jsx-a11y-x/anchor-ambiguous-text": "warn",
121
+ "jsx-a11y-x/anchor-has-content": ["error", { components: userAnchorComponents }],
122
+ "jsx-a11y-x/anchor-is-valid": ["error", {
123
+ specialLink: ["to"],
124
+ components: userAnchorComponents
125
+ }],
126
+ "jsx-a11y-x/aria-activedescendant-has-tabindex": "error",
127
+ "jsx-a11y-x/aria-props": "error",
128
+ "jsx-a11y-x/aria-proptypes": "error",
129
+ "jsx-a11y-x/aria-role": "error",
130
+ "jsx-a11y-x/aria-unsupported-elements": "error",
131
+ "jsx-a11y-x/autocomplete-valid": "error",
132
+ "jsx-a11y-x/click-events-have-key-events": "error",
133
+ "jsx-a11y-x/control-has-associated-label": "error",
134
+ "jsx-a11y-x/heading-has-content": ["error", { components: userHeadingComponents }],
135
+ "jsx-a11y-x/html-has-lang": "error",
136
+ "jsx-a11y-x/iframe-has-title": "error",
137
+ "jsx-a11y-x/img-redundant-alt": ["error", { components: userImageComponents }],
138
+ "jsx-a11y-x/interactive-supports-focus": "error",
139
+ "jsx-a11y-x/label-has-associated-control": "error",
140
+ "jsx-a11y-x/lang": "error",
141
+ "jsx-a11y-x/media-has-caption": "error",
142
+ "jsx-a11y-x/mouse-events-have-key-events": "error",
143
+ "jsx-a11y-x/no-access-key": "warn",
144
+ "jsx-a11y-x/no-aria-hidden-on-focusable": "error",
145
+ "jsx-a11y-x/no-autofocus": "warn",
146
+ "jsx-a11y-x/no-distracting-elements": "warn",
147
+ "jsx-a11y-x/no-interactive-element-to-noninteractive-role": "error",
148
+ "jsx-a11y-x/no-noninteractive-element-interactions": "error",
149
+ "jsx-a11y-x/no-noninteractive-element-to-interactive-role": "error",
150
+ "jsx-a11y-x/no-noninteractive-tabindex": "error",
151
+ "jsx-a11y-x/no-redundant-roles": "warn",
152
+ "jsx-a11y-x/no-static-element-interactions": "warn",
153
+ "jsx-a11y-x/prefer-tag-over-role": "warn",
154
+ "jsx-a11y-x/role-has-required-aria-props": "warn",
155
+ "jsx-a11y-x/role-supports-aria-props": "warn",
156
+ "jsx-a11y-x/scope": "error",
157
+ "jsx-a11y-x/tabindex-no-positive": "error"
162
158
  };
159
+ if (isEnabled(react) && isEnabled(react.accessibility)) Object.assign(reactRules, jsxA11yXRules);
160
+ if (isEnabled(tailwind)) {
161
+ reactRules["better-tailwindcss/no-duplicate-classes"] = "off";
162
+ if (tailwind.multilineSort) reactRules["@html-eslint/react/classname-spacing"] = "off";
163
+ }
164
+ return reactRules;
163
165
  }
164
166
  //#endregion
165
167
  export { getReactRules };
@@ -48,7 +48,7 @@ function getStylisticRules(options) {
48
48
  multi: 1,
49
49
  single: maxAttributesPerLine
50
50
  } }],
51
- "@stylistic/jsx-one-expression-per-line": "warn",
51
+ "@stylistic/jsx-one-expression-per-line": ["warn", { allow: "single-line" }],
52
52
  "@stylistic/exp-jsx-props-style": ["warn", { singleLine: { maxItems: maxAttributesPerLine } }],
53
53
  "@stylistic/jsx-quotes": ["warn", jsxQuotes],
54
54
  "@stylistic/jsx-tag-spacing": "warn",
@@ -30,7 +30,7 @@ function getTanstackRules(options) {
30
30
  package: "@tanstack/router-core",
31
31
  name: "NotFoundError"
32
32
  }] }];
33
- if (isEnabled(tanstack.start)) Object.assign(rules, tanstackStartRules);
33
+ if (isEnabled(tanstack.start) && isEnabled(typescript)) Object.assign(rules, tanstackStartRules);
34
34
  if (isEnabled(tanstack.query)) Object.assign(rules, tanstackQueryRules);
35
35
  if (isEnabled(tanstack.router)) Object.assign(rules, tanstackRouterRules);
36
36
  return rules;
@@ -2,7 +2,7 @@ import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
2
2
  import { isEnabled } from "../utils/isEnabled.mjs";
3
3
  //#region src/rules/typescript.ts
4
4
  function getTypescriptRules(options) {
5
- const { typescript } = options.configs;
5
+ const { unicorn, typescript } = options.configs;
6
6
  const { removeUnusedImports, typeDefinitionStyle, methodSignatureStyle } = isEnabled(typescript) ? typescript : defaultOptions.configs.typescript;
7
7
  return {
8
8
  "@typescript-eslint/await-thenable": "error",
@@ -35,7 +35,7 @@ function getTypescriptRules(options) {
35
35
  "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
36
36
  "@typescript-eslint/no-non-null-assertion": "error",
37
37
  "@typescript-eslint/no-redundant-type-constituents": "error",
38
- "@typescript-eslint/no-require-imports": "error",
38
+ "@typescript-eslint/no-require-imports": isEnabled(unicorn) ? "off" : "error",
39
39
  "@typescript-eslint/no-this-alias": "error",
40
40
  "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
41
41
  "@typescript-eslint/no-unnecessary-condition": ["error", { allowConstantLoopConditions: "only-allowed-literals" }],
@@ -49,6 +49,7 @@ function getTypescriptRules(options) {
49
49
  "@typescript-eslint/no-unsafe-assignment": "warn",
50
50
  "@typescript-eslint/no-unsafe-call": "warn",
51
51
  "@typescript-eslint/no-unsafe-declaration-merging": "warn",
52
+ "@typescript-eslint/no-unsafe-enum-assignment": "error",
52
53
  "@typescript-eslint/no-unsafe-enum-comparison": "error",
53
54
  "@typescript-eslint/no-unsafe-function-type": "warn",
54
55
  "@typescript-eslint/no-unsafe-member-access": "warn",
@@ -2,7 +2,7 @@ import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
2
2
  import { isEnabled } from "../utils/isEnabled.mjs";
3
3
  //#region src/rules/unicorn.ts
4
4
  function getUnicornRules(options) {
5
- const { unicorn, stylistic } = options.configs;
5
+ const { node, unicorn, stylistic, typescript } = options.configs;
6
6
  const { functionStyle } = isEnabled(unicorn) ? unicorn : defaultOptions.configs.unicorn;
7
7
  return {
8
8
  "unicorn/better-dom-traversing": "warn",
@@ -40,6 +40,7 @@ function getUnicornRules(options) {
40
40
  "unicorn/no-array-from-fill": "warn",
41
41
  "unicorn/no-array-method-this-argument": "warn",
42
42
  "unicorn/no-array-sort-for-min-max": "warn",
43
+ "unicorn/no-async-iterator-callback": "error",
43
44
  "unicorn/no-async-promise-finally": "warn",
44
45
  "unicorn/no-await-expression-member": "warn",
45
46
  "unicorn/no-await-in-promise-methods": "error",
@@ -63,11 +64,22 @@ function getUnicornRules(options) {
63
64
  "unicorn/no-for-loop": "warn",
64
65
  "unicorn/no-immediate-mutation": "warn",
65
66
  "unicorn/no-impossible-length-comparison": "error",
67
+ "unicorn/no-incomplete-accessor-override": "error",
66
68
  "unicorn/no-incorrect-query-selector": "error",
67
69
  "unicorn/no-incorrect-template-string-interpolation": "error",
70
+ "unicorn/no-ineffective-csp-directives": "error",
71
+ "unicorn/no-invalid-boolean-attribute-value": "error",
68
72
  "unicorn/no-invalid-character-comparison": "error",
73
+ "unicorn/no-invalid-dom-token": "error",
69
74
  "unicorn/no-invalid-fetch-options": "error",
75
+ "unicorn/no-invalid-file-input-accept": "error",
76
+ "unicorn/no-invalid-intl-options": "error",
77
+ "unicorn/no-invalid-property-descriptor": "error",
70
78
  "unicorn/no-invalid-remove-event-listener": "error",
79
+ "unicorn/no-invalid-response-options": "error",
80
+ "unicorn/no-invalid-style-set-property": "error",
81
+ "unicorn/no-invalid-temporal-arithmetic": "error",
82
+ "unicorn/no-invalid-url-protocol-comparison": "error",
71
83
  "unicorn/no-invalid-well-known-symbol-methods": "error",
72
84
  "unicorn/no-late-current-target-access": "warn",
73
85
  "unicorn/no-late-event-control": "error",
@@ -78,7 +90,7 @@ function getUnicornRules(options) {
78
90
  "unicorn/no-misrefactored-assignment": "warn",
79
91
  "unicorn/no-multiple-promise-resolver-calls": "error",
80
92
  "unicorn/no-negated-array-predicate": "warn",
81
- "unicorn/no-negated-comparison": ["warn", { checkLogicalExpressions: false }],
93
+ "unicorn/no-negated-comparison": "warn",
82
94
  "unicorn/no-negation-in-equality-check": "warn",
83
95
  "unicorn/no-nested-ternary": "warn",
84
96
  "unicorn/no-new-buffer": "error",
@@ -86,6 +98,7 @@ function getUnicornRules(options) {
86
98
  "unicorn/no-object-as-default-parameter": "warn",
87
99
  "unicorn/no-object-methods-with-collections": "warn",
88
100
  "unicorn/no-optional-chaining-on-undeclared-variable": "error",
101
+ "unicorn/no-prevent-default-in-passive-listener": "error",
89
102
  "unicorn/no-redundant-comparison": "warn",
90
103
  "unicorn/no-return-array-push": "warn",
91
104
  "unicorn/no-selector-as-dom-name": "error",
@@ -103,6 +116,7 @@ function getUnicornRules(options) {
103
116
  "unicorn/no-unnecessary-fetch-options": "warn",
104
117
  "unicorn/no-unnecessary-global-this": "warn",
105
118
  "unicorn/no-unnecessary-nested-ternary": "warn",
119
+ "unicorn/no-unnecessary-parameters": "warn",
106
120
  "unicorn/no-unnecessary-polyfills": "warn",
107
121
  "unicorn/no-unnecessary-slice-end": "warn",
108
122
  "unicorn/no-unnecessary-splice": "warn",
@@ -111,10 +125,13 @@ function getUnicornRules(options) {
111
125
  "unicorn/no-unreadable-iife": "warn",
112
126
  "unicorn/no-unreadable-new-expression": "warn",
113
127
  "unicorn/no-unsafe-buffer-conversion": "warn",
128
+ "unicorn/no-unsafe-json-serialization": "error",
114
129
  "unicorn/no-unsafe-promise-all-settled-values": "error",
115
130
  "unicorn/no-unsafe-property-key": "error",
116
- "unicorn/no-unused-array-method-return": "warn",
131
+ "unicorn/no-unused-builtin-method-return": "warn",
132
+ "unicorn/no-unused-iterator-helper": "warn",
117
133
  "unicorn/no-unused-properties": "warn",
134
+ "unicorn/no-url-in-search-params": "warn",
118
135
  "unicorn/no-useless-boolean-cast": "warn",
119
136
  "unicorn/no-useless-collection-argument": "warn",
120
137
  "unicorn/no-useless-compound-assignment": "warn",
@@ -130,10 +147,12 @@ function getUnicornRules(options) {
130
147
  "unicorn/no-useless-promise-resolve-reject": "warn",
131
148
  "unicorn/no-useless-re-export": "warn",
132
149
  "unicorn/no-useless-recursion": "warn",
150
+ "unicorn/no-useless-set-construction": "warn",
133
151
  "unicorn/no-useless-spread": "warn",
134
152
  "unicorn/no-useless-switch-case": "warn",
135
153
  "unicorn/no-useless-template-literals": "warn",
136
154
  "unicorn/no-useless-undefined": ["warn", { checkArrowFunctionBody: false }],
155
+ "unicorn/no-using-resource-escape": "error",
137
156
  "unicorn/no-xor-as-exponentiation": "error",
138
157
  "unicorn/no-zero-fractions": "warn",
139
158
  "unicorn/number-literal-case": "warn",
@@ -160,6 +179,10 @@ function getUnicornRules(options) {
160
179
  "unicorn/prefer-class-fields": "warn",
161
180
  "unicorn/prefer-classlist-toggle": "warn",
162
181
  "unicorn/prefer-code-point": "error",
182
+ "unicorn/prefer-combined-guards": ["warn", {
183
+ checkCompoundConditions: true,
184
+ checkMultiStatementBodies: true
185
+ }],
163
186
  "unicorn/prefer-continue": ["warn", { maximumStatements: 3 }],
164
187
  "unicorn/prefer-date-now": "warn",
165
188
  "unicorn/prefer-direct-iteration": "warn",
@@ -181,13 +204,16 @@ function getUnicornRules(options) {
181
204
  "unicorn/prefer-https": "warn",
182
205
  "unicorn/prefer-identifier-import-export-specifiers": "warn",
183
206
  "unicorn/prefer-import-meta-properties": "warn",
184
- "unicorn/prefer-includes": "warn",
207
+ "unicorn/prefer-includes": isEnabled(typescript) ? "off" : "warn",
185
208
  "unicorn/prefer-iterable-in-constructor": "warn",
186
209
  "unicorn/prefer-iterator-concat": "warn",
187
210
  "unicorn/prefer-iterator-helpers": "warn",
188
211
  "unicorn/prefer-iterator-to-array": "warn",
189
212
  "unicorn/prefer-iterator-to-array-at-end": "warn",
213
+ "unicorn/prefer-iterator-zip": "warn",
214
+ "unicorn/prefer-json-import": "warn",
190
215
  "unicorn/prefer-keyboard-event-key": "error",
216
+ "unicorn/prefer-literal-ascii": "warn",
191
217
  "unicorn/prefer-location-assign": "warn",
192
218
  "unicorn/prefer-logical-operator-over-ternary": "warn",
193
219
  "unicorn/prefer-map-from-entries": "warn",
@@ -200,7 +226,7 @@ function getUnicornRules(options) {
200
226
  "unicorn/prefer-module": "error",
201
227
  "unicorn/prefer-native-coercion-functions": "warn",
202
228
  "unicorn/prefer-negative-index": "warn",
203
- "unicorn/prefer-node-protocol": "warn",
229
+ "unicorn/prefer-node-protocol": isEnabled(node) ? "off" : "warn",
204
230
  "unicorn/prefer-number-coercion": "warn",
205
231
  "unicorn/prefer-number-is-safe-integer": "warn",
206
232
  "unicorn/prefer-number-properties": "warn",
@@ -212,6 +238,7 @@ function getUnicornRules(options) {
212
238
  "unicorn/prefer-optional-catch-binding": "warn",
213
239
  "unicorn/prefer-path2d": "warn",
214
240
  "unicorn/prefer-private-class-fields": "warn",
241
+ "unicorn/prefer-promise-static-methods": "warn",
215
242
  "unicorn/prefer-promise-try": "warn",
216
243
  "unicorn/prefer-promise-with-resolvers": "warn",
217
244
  "unicorn/prefer-queue-microtask": "warn",
@@ -222,9 +249,10 @@ function getUnicornRules(options) {
222
249
  "unicorn/prefer-scoped-selector": "warn",
223
250
  "unicorn/prefer-set-methods": "warn",
224
251
  "unicorn/prefer-set-size": "warn",
252
+ "unicorn/prefer-short-escape-sequences": "warn",
225
253
  "unicorn/prefer-simple-condition-first": "warn",
226
254
  "unicorn/prefer-simple-sort-comparator": "warn",
227
- "unicorn/prefer-simplified-conditions": "warn",
255
+ "unicorn/prefer-simplified-conditions": ["warn", { negatedConditions: "expand" }],
228
256
  "unicorn/prefer-single-array-predicate": "warn",
229
257
  "unicorn/prefer-single-call": "warn",
230
258
  "unicorn/prefer-single-object-destructuring": "warn",
@@ -236,15 +264,17 @@ function getUnicornRules(options) {
236
264
  "unicorn/prefer-string-repeat": "warn",
237
265
  "unicorn/prefer-string-replace-all": "warn",
238
266
  "unicorn/prefer-string-slice": "warn",
239
- "unicorn/prefer-string-starts-ends-with": "warn",
267
+ "unicorn/prefer-string-starts-ends-with": isEnabled(typescript) ? "off" : "warn",
240
268
  "unicorn/prefer-string-trim-start-end": "warn",
241
269
  "unicorn/prefer-structured-clone": "warn",
242
270
  "unicorn/prefer-temporal": "warn",
271
+ "unicorn/prefer-temporal-conversion": "warn",
243
272
  "unicorn/prefer-then-catch": "warn",
244
273
  "unicorn/prefer-toggle-attribute": "warn",
245
274
  "unicorn/prefer-top-level-await": "warn",
246
275
  "unicorn/prefer-type-error": "warn",
247
276
  "unicorn/prefer-uint8array-base64": "warn",
277
+ "unicorn/prefer-uint8array-hex": "warn",
248
278
  "unicorn/prefer-unary-minus": "warn",
249
279
  "unicorn/prefer-url-can-parse": "warn",
250
280
  "unicorn/prefer-url-href": "warn",
@@ -258,6 +288,7 @@ function getUnicornRules(options) {
258
288
  "unicorn/require-number-to-fixed-digits-argument": "warn",
259
289
  "unicorn/require-passive-events": "warn",
260
290
  "unicorn/require-proxy-trap-boolean-return": "error",
291
+ "unicorn/require-text-decoder-streaming": "error",
261
292
  "unicorn/switch-case-braces": "warn",
262
293
  "unicorn/switch-case-break-position": "error",
263
294
  "unicorn/template-indent": "warn",
@@ -19,42 +19,6 @@ function getVueRules(options) {
19
19
  const restrictedVueInputs = isNuxtUIEnabled ? getRestrictedVueInputs(nuxtUIPrefix) : [];
20
20
  const isScriptLangTS = blockLang.script === "ts";
21
21
  const isStyleLangImplicit = blockLang.style === "implicit";
22
- const vueAccessibilityRules = {
23
- "vuejs-accessibility/alt-text": ["error", { img: userImageComponents }],
24
- "vuejs-accessibility/anchor-has-content": ["error", {
25
- components: userAnchorComponents,
26
- accessibleChildren: userAccessibleChildComponents
27
- }],
28
- "vuejs-accessibility/aria-props": "error",
29
- "vuejs-accessibility/aria-role": "error",
30
- "vuejs-accessibility/aria-unsupported-elements": "error",
31
- "vuejs-accessibility/form-control-has-label": ["error", { labelComponents: isNuxtUIEnabled ? [`${nuxtUIPrefix}FormField`] : void 0 }],
32
- "vuejs-accessibility/heading-has-content": "error",
33
- "vuejs-accessibility/iframe-has-title": "error",
34
- "vuejs-accessibility/interactive-supports-focus": "error",
35
- "vuejs-accessibility/label-has-for": ["error", {
36
- allowChildren: true,
37
- required: { some: ["nesting", "id"] },
38
- controlComponents: [
39
- "input",
40
- "output",
41
- "meter",
42
- "select",
43
- "textarea",
44
- "progress"
45
- ]
46
- }],
47
- "vuejs-accessibility/media-has-caption": "error",
48
- "vuejs-accessibility/no-access-key": "warn",
49
- "vuejs-accessibility/no-aria-hidden-on-focusable": "error",
50
- "vuejs-accessibility/no-autofocus": "warn",
51
- "vuejs-accessibility/no-distracting-elements": "warn",
52
- "vuejs-accessibility/no-redundant-roles": "warn",
53
- "vuejs-accessibility/no-role-presentation-on-focusable": "error",
54
- "vuejs-accessibility/no-static-element-interactions": "error",
55
- "vuejs-accessibility/role-has-required-aria-props": "error",
56
- "vuejs-accessibility/tabindex-no-positive": "error"
57
- };
58
22
  const vueRules = {
59
23
  "@typescript-eslint/no-useless-default-assignment": "off",
60
24
  "vue/jsx-uses-vars": "error",
@@ -403,12 +367,45 @@ function getVueRules(options) {
403
367
  "vue/v-for-delimiter-style": ["warn", vForDelimiterStyle],
404
368
  "vue/v-on-handler-style": ["warn", vOnHandlerStyle]
405
369
  };
406
- if (isEnabled(stylistic)) vueRules["@stylistic/max-len"] = "off";
407
- const isVueAccessibilityEnabled = isEnabled(vue) && isEnabled(vue.accessibility);
408
- return {
409
- ...vueRules,
410
- ...isVueAccessibilityEnabled && vueAccessibilityRules
370
+ const vueAccessibilityRules = {
371
+ "vuejs-accessibility/alt-text": ["error", { img: userImageComponents }],
372
+ "vuejs-accessibility/anchor-has-content": ["error", {
373
+ components: userAnchorComponents,
374
+ accessibleChildren: userAccessibleChildComponents
375
+ }],
376
+ "vuejs-accessibility/aria-props": "error",
377
+ "vuejs-accessibility/aria-role": "error",
378
+ "vuejs-accessibility/aria-unsupported-elements": "error",
379
+ "vuejs-accessibility/form-control-has-label": ["error", { labelComponents: isNuxtUIEnabled ? [`${nuxtUIPrefix}FormField`] : void 0 }],
380
+ "vuejs-accessibility/heading-has-content": "error",
381
+ "vuejs-accessibility/iframe-has-title": "error",
382
+ "vuejs-accessibility/interactive-supports-focus": "error",
383
+ "vuejs-accessibility/label-has-for": ["error", {
384
+ allowChildren: true,
385
+ required: { some: ["nesting", "id"] },
386
+ controlComponents: [
387
+ "input",
388
+ "output",
389
+ "meter",
390
+ "select",
391
+ "textarea",
392
+ "progress"
393
+ ]
394
+ }],
395
+ "vuejs-accessibility/media-has-caption": "error",
396
+ "vuejs-accessibility/no-access-key": "warn",
397
+ "vuejs-accessibility/no-aria-hidden-on-focusable": "error",
398
+ "vuejs-accessibility/no-autofocus": "warn",
399
+ "vuejs-accessibility/no-distracting-elements": "warn",
400
+ "vuejs-accessibility/no-redundant-roles": "warn",
401
+ "vuejs-accessibility/no-role-presentation-on-focusable": "error",
402
+ "vuejs-accessibility/no-static-element-interactions": "error",
403
+ "vuejs-accessibility/role-has-required-aria-props": "error",
404
+ "vuejs-accessibility/tabindex-no-positive": "error"
411
405
  };
406
+ if (isEnabled(vue) && isEnabled(vue.accessibility)) Object.assign(vueRules, vueAccessibilityRules);
407
+ if (isEnabled(stylistic)) vueRules["@stylistic/max-len"] = "off";
408
+ return vueRules;
412
409
  }
413
410
  //#endregion
414
411
  export { getVueRules };
@@ -25,6 +25,7 @@ function getZodRules(options) {
25
25
  "zod-mini/prefer-meta": "warn",
26
26
  "zod-mini/prefer-nullish": "warn",
27
27
  "zod-mini/prefer-tuple-over-array-length": "warn",
28
+ "zod-mini/prefer-validate": "warn",
28
29
  "zod-mini/require-brand-type-parameter": "error",
29
30
  "zod-mini/require-error-message": "warn"
30
31
  } : {
@@ -63,6 +64,7 @@ function getZodRules(options) {
63
64
  "zod/prefer-top-level-string-formats": "warn",
64
65
  "zod/prefer-trim-before-string-length-checks": "error",
65
66
  "zod/prefer-tuple-over-array-length": "warn",
67
+ "zod/prefer-validate": "warn",
66
68
  "zod/require-brand-type-parameter": "error",
67
69
  "zod/require-error-message": "warn"
68
70
  };