eslint-config-un 1.0.0-beta.5 → 1.0.0-beta.6
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 +17 -11
- package/dist/config-un/resolve-config-async-data.mjs +4 -9
- package/dist/config-un/shared.mjs +0 -1
- package/dist/configs/astro.d.mts +2 -3
- package/dist/configs/e18e.mjs +2 -1
- package/dist/configs/eslint-plugin.mjs +1 -1
- package/dist/configs/extra/no-stylistic-rules.d.mts +1 -0
- package/dist/configs/extra/no-stylistic-rules.mjs +1 -0
- package/dist/configs/index.d.mts +2 -2
- package/dist/configs/jsdoc.d.mts +25 -9
- package/dist/configs/jsx-a11y.mjs +15 -14
- package/dist/configs/package-json.mjs +1 -1
- package/dist/configs/perfectionist.d.mts +1 -1
- package/dist/configs/react.mjs +1 -1
- package/dist/configs/stylistic.mjs +1 -1
- package/dist/configs/ts.d.mts +3 -3
- package/dist/configs/vitest.mjs +1 -1
- package/dist/eslint-rules.gen.mjs +6 -0
- package/dist/eslint-types-fixable-only.gen.d.mts +1 -1
- package/dist/eslint-types-per-plugin.gen.d.mts +851 -437
- package/dist/eslint-types.gen.d.mts +851 -437
- package/dist/eslint.d.mts +1 -1
- package/dist/eslint.mjs +2 -2
- package/dist/loaders/packages.d.mts +4 -4
- package/dist/loaders/plugins.d.mts +11 -9
- package/dist/package.mjs +22 -22
- package/dist/snippets.d.mts +2 -5
- package/dist/snippets.mjs +2 -3
- package/package.json +73 -73
package/README.md
CHANGED
|
@@ -185,15 +185,20 @@ The Config has the following interface (exact types are simplified for docs):
|
|
|
185
185
|
```ts
|
|
186
186
|
type Severity = 0 | 1 | 2 | 'off' | 'warn' | 'error';
|
|
187
187
|
|
|
188
|
-
type RuleOptions = {
|
|
188
|
+
type RuleOptions = {
|
|
189
|
+
/* ... pre-generated all rules' options */
|
|
190
|
+
};
|
|
189
191
|
|
|
190
|
-
type UnRuleEntry<RuleName extends string> =
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
192
|
+
type UnRuleEntry<RuleName extends string> =
|
|
193
|
+
| Severity
|
|
194
|
+
| [Severity, RuleOptions[RuleName]]
|
|
195
|
+
| {
|
|
196
|
+
severity: Severity;
|
|
197
|
+
options?: RuleOptions[RuleName];
|
|
198
|
+
disableAutofix?: boolean;
|
|
199
|
+
files?: string[];
|
|
200
|
+
ignores?: string[];
|
|
201
|
+
};
|
|
197
202
|
|
|
198
203
|
type UnConfig =
|
|
199
204
|
| boolean
|
|
@@ -860,13 +865,12 @@ We use [`import-meta-resolve`](https://npmjs.com/import-meta-resolve) package to
|
|
|
860
865
|
> on package detection if your dependencies are installed in such a way that non-direct dependencies
|
|
861
866
|
> can be resolved.
|
|
862
867
|
>
|
|
863
|
-
> If this is the case, at least
|
|
868
|
+
> If this is the case, at least 2 additional packages will be considered detected as installed
|
|
864
869
|
> regardless of whether they are actually installed in the root of your project, because they are
|
|
865
870
|
> sub-dependencies of eslint-config-un's direct dependencies:
|
|
866
871
|
>
|
|
867
872
|
> - `typescript` (enables `ts` config and friends);
|
|
868
|
-
> - `prettier` (causes Prettier-incompatible rules to be disabled)
|
|
869
|
-
> - `lodash` (enables `youDontNeedLodashUnderscore` config).
|
|
873
|
+
> - `prettier` (causes Prettier-incompatible rules to be disabled).
|
|
870
874
|
|
|
871
875
|
### How can I know which configs will be enabled, for which rules autofix will be disabled, etc.?
|
|
872
876
|
|
|
@@ -903,6 +907,8 @@ Before committing, please do also run tests, formatter, other linters and tools
|
|
|
903
907
|
4. Perform the following two steps in any order:
|
|
904
908
|
1. Enable stylistic rules only and fix them automatically (if you wish to do so) by running ESLint with `--fix --fix-type problem,suggestion,layout` (the latter flag ensures auto removal of "unused" `eslint-disable` comments will not happen):
|
|
905
909
|
|
|
910
|
+
<!-- eslint-skip -->
|
|
911
|
+
|
|
906
912
|
```ts
|
|
907
913
|
// ...
|
|
908
914
|
configs: {
|
|
@@ -147,7 +147,7 @@ ${renderTable(packages.toSorted((a, b) => a.name.localeCompare(b.name)).map(({ n
|
|
|
147
147
|
}];
|
|
148
148
|
}));
|
|
149
149
|
const loadedPackagesMap = Object.fromEntries(loadedPackages.filter((v) => v != null).map((v) => [v.packagePrefix, v.packageModule]));
|
|
150
|
-
const allPackageUses = cacheData ?
|
|
150
|
+
const allPackageUses = cacheData ? objectEntriesUnsafe(cacheData.usedPackages).flatMap(([packagePrefix, packageUses = []]) => packageUses.map(({ configName, property, valueTransformFn }) => {
|
|
151
151
|
const config = cachedConfigsByName[configName];
|
|
152
152
|
if (!config) return null;
|
|
153
153
|
return {
|
|
@@ -172,15 +172,10 @@ ${renderTable(packages.toSorted((a, b) => a.name.localeCompare(b.name)).map(({ n
|
|
|
172
172
|
...packageUse,
|
|
173
173
|
path: [packageUse.path, packageUse.info.property].filter(Boolean).join(".")
|
|
174
174
|
})));
|
|
175
|
-
const packagesUsesGrouped = Object.entries(groupBy(allPackageUses, (v) => v.path)).map(([fullPath, items]) => ({
|
|
176
|
-
fullPath,
|
|
177
|
-
items
|
|
178
|
-
}));
|
|
179
175
|
configModifyFns.push(() => {
|
|
180
|
-
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
setValueByPath(config, fullPath, valueTransformFn ? valueTransformFn.fn.call(valueTransformFn.scope, packageModules, getValueByPath(config, fullPath)) : Object.keys(packageModules).length === 1 ? Object.values(packageModules)[0] : packageModules);
|
|
176
|
+
allPackageUses.forEach(({ config, path: fullPath, info: { valueTransformFn, package: packagesToLoad } }) => {
|
|
177
|
+
const loadedPackagesForConfig = Object.fromEntries(arraify(packagesToLoad).map((packageId) => [packageId, loadedPackagesMap[packageId]]));
|
|
178
|
+
setValueByPath(config, fullPath, valueTransformFn ? valueTransformFn.fn.call(valueTransformFn.scope, loadedPackagesForConfig, getValueByPath(config, fullPath)) : Object.keys(loadedPackagesForConfig).length === 1 ? Object.values(loadedPackagesForConfig)[0] : loadedPackagesForConfig);
|
|
184
179
|
});
|
|
185
180
|
});
|
|
186
181
|
return {
|
|
@@ -10,7 +10,6 @@ const RULES_TO_DISABLE_AUTOFIX_GLOBALLY_BY_DEFAULT = {
|
|
|
10
10
|
"unicorn/explicit-length-check": true,
|
|
11
11
|
"unicorn/no-useless-undefined": true,
|
|
12
12
|
"unicorn/prefer-spread": true,
|
|
13
|
-
"vitest/prefer-import-in-mock": true,
|
|
14
13
|
"vitest/prefer-lowercase-title": true,
|
|
15
14
|
"github-actions/action-name-casing": true
|
|
16
15
|
};
|
package/dist/configs/astro.d.mts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JsxA11yEslintConfigOptions } from "./jsx-a11y.mjs";
|
|
1
|
+
import { PickKeysNotStartingWith, PickKeysStartingWith } from "../types.mjs";
|
|
3
2
|
import "./index.mjs";
|
|
4
3
|
import { ExtraPluginsType } from "../config-un/shared.mjs";
|
|
5
4
|
import { RulesRecordPartial, UnConfigOptions } from "../eslint.mjs";
|
|
@@ -14,7 +13,7 @@ interface AstroEslintConfigOptions<ExtraPlugins extends ExtraPluginsType = never
|
|
|
14
13
|
* under the hood, this config also accepts the same options as `jsxA11y` config.
|
|
15
14
|
* @default true
|
|
16
15
|
*/
|
|
17
|
-
configJsxA11y?: boolean |
|
|
16
|
+
configJsxA11y?: boolean | UnConfigOptions<ExtraPlugins, PickKeysStartingWith<RulesRecordPartial<'astro'>, 'astro/jsx-a11y'>>;
|
|
18
17
|
}
|
|
19
18
|
//#endregion
|
|
20
19
|
export { AstroEslintConfigOptions };
|
package/dist/configs/e18e.mjs
CHANGED
|
@@ -48,7 +48,8 @@ var e18e_default = ((context, optionsRaw) => {
|
|
|
48
48
|
const configBuilderPerformanceImprovementsTypescript = context.createConfigBuilder(configPerformanceImprovementsTypescript, "e18e");
|
|
49
49
|
if (configPerformanceImprovementsTypescript) configBuilderPerformanceImprovementsTypescript?.addConfig(["e18e/performance-improvements/type-aware", {
|
|
50
50
|
includeDefaultFilesAndIgnores: true,
|
|
51
|
-
filesFallback: [GLOB_TS_X]
|
|
51
|
+
filesFallback: [GLOB_TS_X],
|
|
52
|
+
ignoreMarkdownCodeBlocks: true
|
|
52
53
|
}]).addRule("no-indexof-equality", ERROR).addRule("prefer-regex-test", ERROR).enableConfigTesterForPlugin("e18e", { rulesToSkipInConfig: (ruleName) => !E18E_RULES_PERFORMANCE_IMPROVEMENTS_TS_SET.has(ruleName) }).addOverrides();
|
|
53
54
|
return {
|
|
54
55
|
configs: [
|
|
@@ -18,7 +18,7 @@ var eslint_plugin_default = ((context, optionsRaw) => {
|
|
|
18
18
|
const configBuilder = context.createConfigBuilder(optionsResolved, "eslint-plugin");
|
|
19
19
|
const getRuleDisallowingMetaPropertySeverity = (property, defaultValue) => (metaProperties[property] ?? defaultValue) === "disallow" ? ERROR : OFF;
|
|
20
20
|
const getRuleEnforcingMetaPropertySeverity = (property, defaultValue) => (metaProperties[property] ?? defaultValue) === "enforce" ? ERROR : OFF;
|
|
21
|
-
configBuilder?.addConfig(["eslint-plugin", { includeDefaultFilesAndIgnores: true }]).addRule("fixer-return", ERROR).addRule("meta-property-ordering", ERROR).addRule("no-deprecated-context-methods", ERROR).addRule("no-deprecated-report-api", ERROR).addRule("no-meta-replaced-by", getRuleDisallowingMetaPropertySeverity("replacedBy")).addRule("no-meta-schema-default", getRuleDisallowingMetaPropertySeverity("schemaDefaultProperties")).addRule("no-missing-message-ids", ERROR).addRule("no-missing-placeholders", ERROR).addRule("no-property-in-node", ERROR).addRule("no-unused-message-ids", ERROR).addRule("no-unused-placeholders", ERROR).addRule("no-useless-token-range", ERROR).addRule("prefer-message-ids", ERROR).addRule("prefer-object-rule", ERROR).addRule("prefer-placeholders", ERROR).addRule("prefer-replace-text", ERROR).addRule("report-message-format", ERROR, [`^[A-Z'"\`{]`]).addRule("require-meta-default-options", getRuleEnforcingMetaPropertySeverity("defaultOptions")).addRule("require-meta-docs-description", getRuleEnforcingMetaPropertySeverity("docsDescription")).addRule("require-meta-docs-recommended", getRuleEnforcingMetaPropertySeverity("docsRecommended")).addRule("require-meta-docs-url", getRuleEnforcingMetaPropertySeverity("docsUrl")).addRule("require-meta-fixable", getRuleEnforcingMetaPropertySeverity("fixable", "enforce")).addRule("require-meta-has-suggestions", getRuleEnforcingMetaPropertySeverity("hasSuggestions", "enforce")).addRule("require-meta-schema", getRuleEnforcingMetaPropertySeverity("schema", "enforce")).addRule("require-meta-schema-description", getRuleEnforcingMetaPropertySeverity("schemaDescriptions")).addRule("require-meta-type", getRuleEnforcingMetaPropertySeverity("type", "enforce")).addRule("require-test-case-name", ERROR, [{ require: "objects-with-config" }]).addRule("unique-test-case-names", ERROR).enableConfigTesterForPlugin("eslint-plugin", { rulesToSkipInConfig: (ruleName) => ESLINT_PLUGIN_TESTING_RELATED_RULES_SET.has(ruleName) }).addOverrides();
|
|
21
|
+
configBuilder?.addConfig(["eslint-plugin", { includeDefaultFilesAndIgnores: true }]).addRule("fixer-return", ERROR).addRule("meta-property-ordering", ERROR).addRule("no-deprecated-context-methods", ERROR).addRule("no-deprecated-report-api", ERROR).addRule("no-matching-violation-suggest-message-ids", ERROR).addRule("no-meta-replaced-by", getRuleDisallowingMetaPropertySeverity("replacedBy")).addRule("no-meta-schema-default", getRuleDisallowingMetaPropertySeverity("schemaDefaultProperties")).addRule("no-missing-message-ids", ERROR).addRule("no-missing-placeholders", ERROR).addRule("no-property-in-node", ERROR).addRule("no-unused-message-ids", ERROR).addRule("no-unused-placeholders", ERROR).addRule("no-useless-token-range", ERROR).addRule("prefer-message-ids", ERROR).addRule("prefer-object-rule", ERROR).addRule("prefer-placeholders", ERROR).addRule("prefer-replace-text", ERROR).addRule("report-message-format", ERROR, [`^[A-Z'"\`{]`]).addRule("require-meta-default-options", getRuleEnforcingMetaPropertySeverity("defaultOptions")).addRule("require-meta-docs-description", getRuleEnforcingMetaPropertySeverity("docsDescription")).addRule("require-meta-docs-recommended", getRuleEnforcingMetaPropertySeverity("docsRecommended")).addRule("require-meta-docs-url", getRuleEnforcingMetaPropertySeverity("docsUrl")).addRule("require-meta-fixable", getRuleEnforcingMetaPropertySeverity("fixable", "enforce")).addRule("require-meta-has-suggestions", getRuleEnforcingMetaPropertySeverity("hasSuggestions", "enforce")).addRule("require-meta-schema", getRuleEnforcingMetaPropertySeverity("schema", "enforce")).addRule("require-meta-schema-description", getRuleEnforcingMetaPropertySeverity("schemaDescriptions")).addRule("require-meta-type", getRuleEnforcingMetaPropertySeverity("type", "enforce")).addRule("require-test-case-name", ERROR, [{ require: "objects-with-config" }]).addRule("unique-test-case-names", ERROR).enableConfigTesterForPlugin("eslint-plugin", { rulesToSkipInConfig: (ruleName) => ESLINT_PLUGIN_TESTING_RELATED_RULES_SET.has(ruleName) }).addOverrides();
|
|
22
22
|
const configBuilderRuleTests = context.createConfigBuilder(configRuleTests, "eslint-plugin");
|
|
23
23
|
configBuilderRuleTests?.addConfig(["eslint-plugin", {
|
|
24
24
|
includeDefaultFilesAndIgnores: true,
|
|
@@ -737,6 +737,7 @@ declare const ALL_STYLISTIC_RULES: {
|
|
|
737
737
|
readonly 'prefer-hooks-in-order': true;
|
|
738
738
|
readonly 'prefer-importing-vitest-globals': true;
|
|
739
739
|
readonly 'prefer-lowercase-title': true;
|
|
740
|
+
readonly 'prefer-mock-return-shorthand': true;
|
|
740
741
|
readonly 'prefer-to-be': true;
|
|
741
742
|
readonly 'prefer-to-contain': true;
|
|
742
743
|
readonly 'prefer-to-have-been-called-times': true;
|
|
@@ -699,6 +699,7 @@ const ALL_STYLISTIC_RULES = {
|
|
|
699
699
|
"prefer-hooks-in-order": true,
|
|
700
700
|
"prefer-importing-vitest-globals": true,
|
|
701
701
|
"prefer-lowercase-title": true,
|
|
702
|
+
"prefer-mock-return-shorthand": true,
|
|
702
703
|
"prefer-to-be": true,
|
|
703
704
|
"prefer-to-contain": true,
|
|
704
705
|
"prefer-to-have-been-called-times": true,
|
package/dist/configs/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { AngularEslintConfigOptions } from "./angular.mjs";
|
|
2
2
|
import { AntfuEslintConfigOptions } from "./antfu.mjs";
|
|
3
|
-
import "../utils.mjs";
|
|
4
|
-
import { JsxA11yEslintConfigOptions } from "./jsx-a11y.mjs";
|
|
5
3
|
import { AstroEslintConfigOptions } from "./astro.mjs";
|
|
4
|
+
import "../utils.mjs";
|
|
6
5
|
import { JestEslintConfigOptions } from "./jest.mjs";
|
|
7
6
|
import { AvaEslintConfigOptions } from "./ava.mjs";
|
|
8
7
|
import { BarrelFilesEslintConfigOptions } from "./barrel-files.mjs";
|
|
@@ -48,6 +47,7 @@ import { JsInlineEslintConfigOptions } from "./js-inline.mjs";
|
|
|
48
47
|
import { JsdocEslintConfigOptions } from "./jsdoc.mjs";
|
|
49
48
|
import { JsonSchemaValidatorEslintConfigOptions } from "./json-schema-validator.mjs";
|
|
50
49
|
import { JsoncEslintConfigOptions } from "./jsonc.mjs";
|
|
50
|
+
import { JsxA11yEslintConfigOptions } from "./jsx-a11y.mjs";
|
|
51
51
|
import { LitEslintConfigOptions } from "./lit.mjs";
|
|
52
52
|
import { LockfileEslintConfigOptions } from "./lockfile.mjs";
|
|
53
53
|
import { MarkdownEslintConfigOptions } from "./markdown.mjs";
|
package/dist/configs/jsdoc.d.mts
CHANGED
|
@@ -5,7 +5,8 @@ import { UnConfigOptions } from "../eslint.mjs";
|
|
|
5
5
|
//#region src/configs/jsdoc.d.ts
|
|
6
6
|
interface EslintPluginJsdocSettings {
|
|
7
7
|
/**
|
|
8
|
-
* Disables all rules for the comment block on which a `@private` tag
|
|
8
|
+
* Disables all rules for the comment block on which a `@private` tag
|
|
9
|
+
* (or `@access private`) occurs.
|
|
9
10
|
* @default false
|
|
10
11
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#allow-tags-private-or-internal-to-disable-rules-for-that-comment-block
|
|
11
12
|
*/
|
|
@@ -17,13 +18,15 @@ interface EslintPluginJsdocSettings {
|
|
|
17
18
|
*/
|
|
18
19
|
ignoreInternal?: boolean;
|
|
19
20
|
/**
|
|
20
|
-
* Indicates how many line breaks (if any) will be checked to find a jsdoc comment block
|
|
21
|
+
* Indicates how many line breaks (if any) will be checked to find a jsdoc comment block
|
|
22
|
+
* before the given code block.
|
|
21
23
|
* @default 0
|
|
22
24
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#maxlines-and-minlines
|
|
23
25
|
*/
|
|
24
26
|
minLines?: number;
|
|
25
27
|
/**
|
|
26
|
-
* Indicates how many line breaks (if any) will be checked to find a jsdoc comment block
|
|
28
|
+
* Indicates how many line breaks (if any) will be checked to find a jsdoc comment block
|
|
29
|
+
* before the given code block.
|
|
27
30
|
* @default 1
|
|
28
31
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#maxlines-and-minlines
|
|
29
32
|
*/
|
|
@@ -35,7 +38,8 @@ interface EslintPluginJsdocSettings {
|
|
|
35
38
|
*/
|
|
36
39
|
mode?: 'typescript' | 'clojure' | 'jsdoc';
|
|
37
40
|
/**
|
|
38
|
-
* Preferred alias name for a JSDoc tag. The format of the configuration is:
|
|
41
|
+
* Preferred alias name for a JSDoc tag. The format of the configuration is:
|
|
42
|
+
* `<primary tag name>`: `<preferred alias name>`
|
|
39
43
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#alias-preference
|
|
40
44
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#default-preferred-aliases for the default list of aliases
|
|
41
45
|
*/
|
|
@@ -56,7 +60,8 @@ interface EslintPluginJsdocSettings {
|
|
|
56
60
|
*/
|
|
57
61
|
overrideReplacesDocs?: boolean;
|
|
58
62
|
/**
|
|
59
|
-
* Allows the omission of the tags corresponding to `require-*` rules if `@augments`
|
|
63
|
+
* Allows the omission of the tags corresponding to `require-*` rules if `@augments`
|
|
64
|
+
* or its alias `@extends` is present.
|
|
60
65
|
* @default false
|
|
61
66
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#overrideaugmentsextendsimplementsignore-without-accompanying-paramdescriptionexamplereturnsthrowsyields
|
|
62
67
|
*/
|
|
@@ -68,7 +73,8 @@ interface EslintPluginJsdocSettings {
|
|
|
68
73
|
*/
|
|
69
74
|
implementsReplacesDocs?: boolean;
|
|
70
75
|
/**
|
|
71
|
-
* Configures [`check-types`](https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/check-types.md)
|
|
76
|
+
* Configures [`check-types`](https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/check-types.md)
|
|
77
|
+
* and [`no-undefined-types`](https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/no-undefined-types.md) rules.
|
|
72
78
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#settings-to-configure-check-types-and-no-undefined-types
|
|
73
79
|
*/
|
|
74
80
|
preferredTypes?: Partial<Record<'*' | '[]' | '.<>' | '.' | '<>' | (string & {}), false | string | {
|
|
@@ -77,7 +83,8 @@ interface EslintPluginJsdocSettings {
|
|
|
77
83
|
*/
|
|
78
84
|
message: string;
|
|
79
85
|
/**
|
|
80
|
-
* Use string to specify the type to be preferred in its place (and which fix mode
|
|
86
|
+
* Use string to specify the type to be preferred in its place (and which fix mode
|
|
87
|
+
* can replace). Use `false` for forbidding the type
|
|
81
88
|
*/
|
|
82
89
|
replacement?: string | false;
|
|
83
90
|
/**
|
|
@@ -86,7 +93,15 @@ interface EslintPluginJsdocSettings {
|
|
|
86
93
|
skipRootChecking?: boolean;
|
|
87
94
|
}>>;
|
|
88
95
|
/**
|
|
89
|
-
*
|
|
96
|
+
* Set to `true` to allow JSDoc blocks to be found across invocations such
|
|
97
|
+
* as call expressions and `new` expressions. Used by
|
|
98
|
+
* [`require-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/require-jsdoc.md).
|
|
99
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.README/settings.md#skipinvokedexpressionsforcommentfinding
|
|
100
|
+
*/
|
|
101
|
+
skipInvokedExpressionsForCommentFinding?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* An object indicating tags whose types and names/namepaths (whether defining or referencing
|
|
104
|
+
* namepaths) will be checked, subject to configuration.
|
|
90
105
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/settings.md#structuredtags
|
|
91
106
|
*/
|
|
92
107
|
structuredTags?: Record<string, {
|
|
@@ -119,7 +134,8 @@ interface EslintPluginJsdocSettings {
|
|
|
119
134
|
forceRequireReturn?: boolean;
|
|
120
135
|
})[];
|
|
121
136
|
/**
|
|
122
|
-
* Configures [`require-param-type`](https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/require-param-type.md)
|
|
137
|
+
* Configures [`require-param-type`](https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/require-param-type.md)
|
|
138
|
+
* and [`require-param-description`](https://github.com/gajus/eslint-plugin-jsdoc/blob/HEAD/docs/rules/require-param-description.md) rules.
|
|
123
139
|
*/
|
|
124
140
|
exemptDestructuredRootsFromChecks?: boolean;
|
|
125
141
|
}
|
|
@@ -57,11 +57,12 @@ var jsx_a11y_default = ((context, optionsRawFromParameters, customConfig) => {
|
|
|
57
57
|
const isForAstro = prefixFinal === "astro";
|
|
58
58
|
const isForLit = prefix === "lit";
|
|
59
59
|
const rn = (ruleName) => `${isForAstro ? "jsx-a11y/" : ""}${ruleName}`;
|
|
60
|
+
const setRuleOptions = (options) => isForAstro ? [] : options;
|
|
60
61
|
const configBuilder = context.createConfigBuilder(optionsResolved, prefixFinal);
|
|
61
62
|
configBuilder?.addConfig([prefixFinal.includes("a11y") ? prefixFinal : `jsx-a11y/${prefixFinal}`, {
|
|
62
63
|
includeDefaultFilesAndIgnores: true,
|
|
63
64
|
filesFallback: [GLOB_JSX_TSX]
|
|
64
|
-
}], { ...pluginSettings && { settings: { ...isForLit ? pluginSettings : { "jsx-a11y-x": pluginSettings } } } }).addRule(rn("alt-text"), altTextCheckForElements === false ? OFF : ERROR, [{
|
|
65
|
+
}], { ...pluginSettings && { settings: { ...isForLit ? pluginSettings : { "jsx-a11y-x": pluginSettings } } } }).addRule(rn("alt-text"), altTextCheckForElements === false ? OFF : ERROR, setRuleOptions([{
|
|
65
66
|
elements: getKeysOfTruthyValues({
|
|
66
67
|
...altTextCheckDefaultElements,
|
|
67
68
|
...altTextCheckForElements
|
|
@@ -70,10 +71,10 @@ var jsx_a11y_default = ((context, optionsRawFromParameters, customConfig) => {
|
|
|
70
71
|
...customComponents.objectElements?.length && { object: customComponents.objectElements },
|
|
71
72
|
...customComponents.areaElements?.length && { area: customComponents.areaElements },
|
|
72
73
|
...customComponents.inputTypeImageElements?.length && { "input[type=\"image\"]": customComponents.inputTypeImageElements }
|
|
73
|
-
}]).addRule(rn("anchor-ambiguous-text"), ambiguousWords === false || isForLit ? OFF : ambiguousWords.severity === "error" ? ERROR : WARNING, [{ ...ambiguousWords && ambiguousWords.words.length > 0 && { words: ambiguousWords.words } }]).addRule(rn("anchor-has-content"), ERROR, [{ ...customComponents.links?.length && { components: customComponents.links } }]).addRule(rn("anchor-is-valid"), anchorIsValidCheckedAspects === false || anchorIsValidFinalCheckedAspects == null ? OFF : ERROR, [{
|
|
74
|
+
}])).addRule(rn("anchor-ambiguous-text"), ambiguousWords === false || isForLit ? OFF : ambiguousWords.severity === "error" ? ERROR : WARNING, setRuleOptions([{ ...ambiguousWords && ambiguousWords.words.length > 0 && { words: ambiguousWords.words } }])).addRule(rn("anchor-has-content"), ERROR, setRuleOptions([{ ...customComponents.links?.length && { components: customComponents.links } }])).addRule(rn("anchor-is-valid"), anchorIsValidCheckedAspects === false || anchorIsValidFinalCheckedAspects == null ? OFF : ERROR, setRuleOptions([{
|
|
74
75
|
...customComponents.links?.length && { components: customComponents.links },
|
|
75
76
|
aspects: anchorIsValidFinalCheckedAspects
|
|
76
|
-
}]).addRule(rn("aria-activedescendant-has-tabindex"), ERROR).addRule(isForLit ? "aria-attrs" : rn("aria-props"), ERROR).addRule(isForLit ? "aria-attr-valid-value" : rn("aria-proptypes"), ERROR).addRule(rn("aria-role"), ERROR).addRule(rn("aria-unsupported-elements"), ERROR).addRule(rn("autocomplete-valid"), ERROR, [{ ...customComponents.inputs?.length && { inputComponents: customComponents.inputs } }]).addRule(rn("click-events-have-key-events"), isForAstro ? OFF : ERROR).addRule(rn("control-has-associated-label"), isForLit ? OFF : ERROR, [{
|
|
77
|
+
}])).addRule(rn("aria-activedescendant-has-tabindex"), ERROR).addRule(isForLit ? "aria-attrs" : rn("aria-props"), ERROR).addRule(isForLit ? "aria-attr-valid-value" : rn("aria-proptypes"), ERROR).addRule(rn("aria-role"), ERROR).addRule(rn("aria-unsupported-elements"), ERROR).addRule(rn("autocomplete-valid"), ERROR, setRuleOptions([{ ...customComponents.inputs?.length && { inputComponents: customComponents.inputs } }])).addRule(rn("click-events-have-key-events"), isForAstro ? OFF : ERROR).addRule(rn("control-has-associated-label"), isForLit ? OFF : ERROR, setRuleOptions([{
|
|
77
78
|
...customComponents.controls?.length && { controlComponents: customComponents.controls },
|
|
78
79
|
...labelAttributes?.length && { labelAttributes },
|
|
79
80
|
ignoreElements: [
|
|
@@ -99,21 +100,21 @@ var jsx_a11y_default = ((context, optionsRawFromParameters, customConfig) => {
|
|
|
99
100
|
"tree",
|
|
100
101
|
"treegrid"
|
|
101
102
|
]
|
|
102
|
-
}]).addRule(rn("heading-has-content"), ERROR, [{ ...customComponents.headings?.length && { inputComponents: customComponents.headings } }]).addRule(rn("html-has-lang"), isForLit ? OFF : OFF).addRule(isForLit ? "iframe-title" : rn("iframe-has-title"), ERROR).addRule(rn("img-redundant-alt"), imageWords === false || imageWords?.words.length === 0 ? OFF : imageWords?.severity === "error" ? ERROR : WARNING, [{
|
|
103
|
+
}])).addRule(rn("heading-has-content"), ERROR, setRuleOptions([{ ...customComponents.headings?.length && { inputComponents: customComponents.headings } }])).addRule(rn("html-has-lang"), isForLit ? OFF : OFF).addRule(isForLit ? "iframe-title" : rn("iframe-has-title"), ERROR).addRule(rn("img-redundant-alt"), imageWords === false || imageWords?.words.length === 0 ? OFF : imageWords?.severity === "error" ? ERROR : WARNING, setRuleOptions([{
|
|
103
104
|
...imageWords && imageWords.words.length > 0 && { words: imageWords.words },
|
|
104
105
|
...customComponents.imgElements?.length && { components: customComponents.imgElements }
|
|
105
|
-
}]).addRule(rn("interactive-supports-focus"), isForLit ? OFF : ERROR, [{ tabbable: getKeysOfTruthyValues({
|
|
106
|
+
}])).addRule(rn("interactive-supports-focus"), isForLit ? OFF : ERROR, setRuleOptions([{ tabbable: getKeysOfTruthyValues({
|
|
106
107
|
...defaultTabbableRoles,
|
|
107
108
|
...tabbableRoles
|
|
108
|
-
}) }]).addRule(rn("label-has-associated-control"), isForLit ? OFF : ERROR, [{
|
|
109
|
+
}) }])).addRule(rn("label-has-associated-control"), isForLit ? OFF : ERROR, setRuleOptions([{
|
|
109
110
|
...labelAttributes?.length && { labelAttributes },
|
|
110
111
|
...customComponents.labels?.length && { labelComponents: customComponents.labels },
|
|
111
112
|
...customComponents.controls?.length && { controlComponents: customComponents.controls }
|
|
112
|
-
}]).addRule(isForLit ? "valid-lang" : rn("lang"), ERROR).addRule("list", isForLit ? ERROR : null).addRule(rn("media-has-caption"), isForLit ? OFF : WARNING, [{
|
|
113
|
+
}])).addRule(isForLit ? "valid-lang" : rn("lang"), ERROR).addRule("list", isForLit ? ERROR : null).addRule(rn("media-has-caption"), isForLit ? OFF : WARNING, setRuleOptions([{
|
|
113
114
|
...customComponents.audioElements?.length && { audio: customComponents.audioElements },
|
|
114
115
|
...customComponents.videoElements?.length && { video: customComponents.videoElements },
|
|
115
116
|
...customComponents.trackElements?.length && { track: customComponents.trackElements }
|
|
116
|
-
}]).addRule(rn("mouse-events-have-key-events"), isForAstro ? OFF : ERROR, [{
|
|
117
|
+
}])).addRule(rn("mouse-events-have-key-events"), isForAstro ? OFF : ERROR, setRuleOptions([{
|
|
117
118
|
hoverInHandlers: getKeysOfTruthyValues({
|
|
118
119
|
...defaultHoverInHandlersRequiringOnFocus,
|
|
119
120
|
...hoverInHandlersRequiringOnFocus
|
|
@@ -122,10 +123,10 @@ var jsx_a11y_default = ((context, optionsRawFromParameters, customConfig) => {
|
|
|
122
123
|
...defaultHoverOutHandlersRequiringOnBlur,
|
|
123
124
|
...hoverOutHandlersRequiringOnBlur
|
|
124
125
|
})
|
|
125
|
-
}]).addRule(rn("no-access-key"), ERROR).addRule(rn("no-aria-hidden-on-focusable"), isForLit ? OFF : WARNING).addRule(rn("no-autofocus"), WARNING, [{ ignoreNonDOM: true }]).addRule(rn("no-distracting-elements"), ERROR).addRule(rn("no-interactive-element-to-noninteractive-role"), isForLit ? OFF : ERROR, [{
|
|
126
|
+
}])).addRule(rn("no-access-key"), ERROR).addRule(rn("no-aria-hidden-on-focusable"), isForLit ? OFF : WARNING).addRule(rn("no-autofocus"), WARNING, setRuleOptions([{ ignoreNonDOM: true }])).addRule(rn("no-distracting-elements"), ERROR).addRule(rn("no-interactive-element-to-noninteractive-role"), isForLit ? OFF : ERROR, setRuleOptions([{
|
|
126
127
|
tr: ["none", "presentation"],
|
|
127
128
|
canvas: ["img"]
|
|
128
|
-
}]).addRule(rn("no-noninteractive-element-interactions"), isForLit ? OFF : ERROR, [{
|
|
129
|
+
}])).addRule(rn("no-noninteractive-element-interactions"), isForLit ? OFF : ERROR, setRuleOptions([{
|
|
129
130
|
handlers: [
|
|
130
131
|
"onClick",
|
|
131
132
|
"onError",
|
|
@@ -149,7 +150,7 @@ var jsx_a11y_default = ((context, optionsRawFromParameters, customConfig) => {
|
|
|
149
150
|
],
|
|
150
151
|
iframe: ["onError", "onLoad"],
|
|
151
152
|
img: ["onError", "onLoad"]
|
|
152
|
-
}]).addRule(rn("no-noninteractive-element-to-interactive-role"), isForLit ? OFF : ERROR, [{
|
|
153
|
+
}])).addRule(rn("no-noninteractive-element-to-interactive-role"), isForLit ? OFF : ERROR, setRuleOptions([{
|
|
153
154
|
ul: [
|
|
154
155
|
"listbox",
|
|
155
156
|
"menu",
|
|
@@ -180,11 +181,11 @@ var jsx_a11y_default = ((context, optionsRawFromParameters, customConfig) => {
|
|
|
180
181
|
table: ["grid"],
|
|
181
182
|
td: ["gridcell"],
|
|
182
183
|
fieldset: ["radiogroup", "presentation"]
|
|
183
|
-
}]).addRule(rn("no-noninteractive-tabindex"), isForLit ? OFF : ERROR, [{
|
|
184
|
+
}])).addRule(rn("no-noninteractive-tabindex"), isForLit ? OFF : ERROR, setRuleOptions([{
|
|
184
185
|
tags: [],
|
|
185
186
|
roles: ["tabpanel"],
|
|
186
187
|
allowExpressionValues: true
|
|
187
|
-
}]).addRule(isForLit ? "no-redundant-role" : rn("no-redundant-roles"), ERROR).addRule(rn("no-static-element-interactions"), isForAstro || isForLit ? OFF : ERROR, [{
|
|
188
|
+
}])).addRule(isForLit ? "no-redundant-role" : rn("no-redundant-roles"), ERROR).addRule(rn("no-static-element-interactions"), isForAstro || isForLit ? OFF : ERROR, setRuleOptions([{
|
|
188
189
|
allowExpressionValues: true,
|
|
189
190
|
handlers: [
|
|
190
191
|
"onClick",
|
|
@@ -194,7 +195,7 @@ var jsx_a11y_default = ((context, optionsRawFromParameters, customConfig) => {
|
|
|
194
195
|
"onKeyDown",
|
|
195
196
|
"onKeyUp"
|
|
196
197
|
]
|
|
197
|
-
}]).addRule(rn("prefer-tag-over-role"), isForLit ? OFF : OFF).addRule(isForLit ? "role-has-required-aria-attrs" : rn("role-has-required-aria-props"), ERROR).addRule(isForLit ? "role-supports-aria-attr" : rn("role-supports-aria-props"), ERROR).addRule(rn("scope"), ERROR).addRule(rn("tabindex-no-positive"), ERROR).enableConfigTesterForPlugin("jsx-a11y", { rulesToSkipInConfig: () => prefixFinal !== "jsx-a11y" }).addOverrides();
|
|
198
|
+
}])).addRule(rn("prefer-tag-over-role"), isForLit ? OFF : OFF).addRule(isForLit ? "role-has-required-aria-attrs" : rn("role-has-required-aria-props"), ERROR).addRule(isForLit ? "role-supports-aria-attr" : rn("role-supports-aria-props"), ERROR).addRule(rn("scope"), ERROR).addRule(rn("tabindex-no-positive"), ERROR).enableConfigTesterForPlugin("jsx-a11y", { rulesToSkipInConfig: () => prefixFinal !== "jsx-a11y" }).addOverrides();
|
|
198
199
|
return {
|
|
199
200
|
configs: [configBuilder],
|
|
200
201
|
optionsResolved
|
|
@@ -32,7 +32,7 @@ var package_json_default = ((context, optionsRaw) => {
|
|
|
32
32
|
includeDefaultFilesAndIgnores: true,
|
|
33
33
|
filesFallback: [GLOB_PACKAGE_JSON],
|
|
34
34
|
parser: "jsonc-eslint-parser"
|
|
35
|
-
}], { ...pluginSettings && { settings: { packageJson: pluginSettings } } }).addRule("bin-name-casing", ERROR).addRule("exports-subpaths-style", ERROR).addRule("no-empty-fields", ERROR, propertiesAllowedToBeEmpty.length > 0 ? [{ ignoreProperties: propertiesAllowedToBeEmpty }] : []).addRule("no-redundant-files", ERROR).addRule("no-redundant-publishConfig", ERROR).addRule("order-properties", ERROR, [{ order }]).addRule("repository-shorthand", ERROR, [{ form: repositoryShorthand }]).addRule("require-attribution", publishable ? ERROR : OFF).addRule("require-author", OFF).addRule("require-bugs", OFF).addRule("require-bundleDependencies", OFF).addRule("require-dependencies", OFF).addRule("require-description", publishable ? ERROR : OFF).addRule("require-devDependencies", OFF).addRule("require-engines", OFF).addRule("require-exports", publishable ? ERROR : OFF).addRule("require-files", publishable ? ERROR : OFF).addRule("require-homepage", OFF).addRule("require-keywords", OFF).addRule("require-license", publishable ? ERROR : OFF).addRule("require-name", ERROR).addRule("require-optionalDependencies", OFF).addRule("require-peerDependencies", OFF).addRule("require-sideEffects", publishable ? ERROR : OFF).addRule("require-type", publishable ? ERROR : OFF).addRule("require-types", OFF).addRule("require-version", ERROR).addRule("restrict-dependency-ranges", OFF).addRule("restrict-private-properties", disallowUnnecessaryPropertiesInPrivatePackages ? ERROR : OFF, Array.isArray(disallowUnnecessaryPropertiesInPrivatePackages) ? [{ blockedProperties: disallowUnnecessaryPropertiesInPrivatePackages }] : []).addRule("scripts-name-casing", ERROR).addRule("sort-collections", ERROR, [getKeysOfTruthyValues({
|
|
35
|
+
}], { ...pluginSettings && { settings: { packageJson: pluginSettings } } }).addRule("bin-name-casing", ERROR).addRule("exports-subpaths-style", ERROR).addRule("no-empty-fields", ERROR, propertiesAllowedToBeEmpty.length > 0 ? [{ ignoreProperties: propertiesAllowedToBeEmpty }] : []).addRule("no-redundant-files", ERROR).addRule("no-redundant-publishConfig", ERROR).addRule("order-properties", ERROR, [{ order }]).addRule("repository-shorthand", ERROR, [{ form: repositoryShorthand }]).addRule("require-attribution", publishable ? ERROR : OFF).addRule("require-author", OFF).addRule("require-bugs", OFF).addRule("require-bundleDependencies", OFF).addRule("require-dependencies", OFF).addRule("require-description", publishable ? ERROR : OFF).addRule("require-devDependencies", OFF).addRule("require-engines", OFF).addRule("require-exports", publishable ? ERROR : OFF).addRule("require-files", publishable ? ERROR : OFF).addRule("require-homepage", OFF).addRule("require-keywords", OFF).addRule("require-license", publishable ? ERROR : OFF).addRule("require-name", ERROR).addRule("require-optionalDependencies", OFF).addRule("require-peerDependencies", OFF).addRule("require-repository", publishable ? ERROR : OFF).addRule("require-scripts", OFF).addRule("require-sideEffects", publishable ? ERROR : OFF).addRule("require-type", publishable ? ERROR : OFF).addRule("require-types", OFF).addRule("require-version", ERROR).addRule("restrict-dependency-ranges", OFF).addRule("restrict-private-properties", disallowUnnecessaryPropertiesInPrivatePackages ? ERROR : OFF, Array.isArray(disallowUnnecessaryPropertiesInPrivatePackages) ? [{ blockedProperties: disallowUnnecessaryPropertiesInPrivatePackages }] : []).addRule("scripts-name-casing", ERROR).addRule("sort-collections", ERROR, [getKeysOfTruthyValues({
|
|
36
36
|
...DEFAULT_COLLECTIONS_TO_SORT,
|
|
37
37
|
...optionsResolved.collectionsToSort
|
|
38
38
|
})]).addRule("specify-peers-locally", ERROR).addRule("unique-dependencies", ERROR).addRule("valid-author", ERROR).addRule("valid-bin", ERROR).addRule("valid-bundleDependencies", ERROR).addRule("valid-config", ERROR).addRule("valid-contributors", ERROR).addRule("valid-cpu", ERROR).addRule("valid-dependencies", ERROR).addRule("valid-description", ERROR).addRule("valid-devDependencies", ERROR).addRule("valid-directories", ERROR).addRule("valid-engines", ERROR).addRule("valid-exports", ERROR).addRule("valid-files", ERROR).addRule("valid-homepage", ERROR).addRule("valid-keywords", ERROR).addRule("valid-license", ERROR).addRule("valid-main", ERROR).addRule("valid-man", ERROR).addRule("valid-module", ERROR).addRule("valid-name", ERROR).addRule("valid-optionalDependencies", ERROR).addRule("valid-os", ERROR).addRule("valid-peerDependencies", ERROR).addRule("valid-private", ERROR).addRule("valid-publishConfig", ERROR).addRule("valid-repository", ERROR).addRule("valid-repository-directory", ERROR).addRule("valid-scripts", ERROR).addRule("valid-sideEffects", ERROR).addRule("valid-type", ERROR).addRule("valid-version", ERROR).addRule("valid-workspaces", ERROR).addAnyRule("node-dependencies", "absolute-version", enforceAbsoluteVersion ? ERROR : OFF, enforceAbsoluteVersion ? [enforceAbsoluteVersion === true ? {
|
|
@@ -15,7 +15,7 @@ interface PerfectionistEslintConfigOptions<ExtraPlugins extends ExtraPluginsType
|
|
|
15
15
|
* that will be assigned to `perfectionist` property and applied to the specified `files` and `ignores`.
|
|
16
16
|
* @see https://perfectionist.dev/guide/getting-started#settings
|
|
17
17
|
*/
|
|
18
|
-
settings?: Prettify<Pick<GetRuleOptions<'perfectionist'>, 'type' | 'order' | 'fallbackSort' | 'alphabet' | 'ignoreCase' | 'specialCharacters' | 'locales'> & Pick<GetRuleOptions<'perfectionist', 'sort-objects'>, 'partitionByComment' | 'partitionByNewLine'>>;
|
|
18
|
+
settings?: Prettify<Pick<GetRuleOptions<'perfectionist'>, 'type' | 'order' | 'fallbackSort' | 'alphabet' | 'ignoreCase' | 'specialCharacters' | 'locales'> & Pick<GetRuleOptions<'perfectionist', 'sort-objects'>, 'partitionByComment' | 'partitionByNewLine' | 'newlinesBetween' | 'newlinesInside'>>;
|
|
19
19
|
/**
|
|
20
20
|
* @default false
|
|
21
21
|
*/
|
package/dist/configs/react.mjs
CHANGED
|
@@ -209,7 +209,7 @@ var react_default = (async (context, optionsRaw, { tsFilesTypeAware, tsIgnoresTy
|
|
|
209
209
|
}]).markCategory("X").addRule("jsx-dollar", WARNING).addRule("jsx-key-before-spread", ERROR).addRule("jsx-no-comment-textnodes", getDoubleRuleSeverity(NO_COMMENT_TEXTNODES_SEVERITY, true)).addRule("jsx-no-duplicate-props", getDoubleRuleSeverity(JSX_NO_DUPLICATE_PROPS_SEVERITY, true)).addRule("jsx-no-iife", OFF).addRule("jsx-no-undef", getDoubleRuleSeverity(JSX_NO_UNDEF_SEVERITY, true)).addRule("jsx-shorthand-boolean", getDoubleRuleSeverity(booleanShorthandSeverity, true), [shorthandBoolean === "prefer-error" || shorthandBoolean === "prefer" ? 1 : -1]).addRule("jsx-shorthand-fragment", getDoubleRuleSeverity(fragmentShorthandSeverity, true), [shorthandFragment === "prefer-error" || shorthandFragment === "prefer" ? 1 : -1]).addRule("jsx-uses-react", getDoubleRuleSeverity(JSX_USES_REACT_SEVERITY, true)).addRule("jsx-uses-vars", getDoubleRuleSeverity(JSX_USES_VARS_SEVERITY, true)).addRule("no-access-state-in-setstate", getDoubleRuleSeverity(NO_ACCESS_STATE_IN_SETSTATE_SEVERITY, true)).addRule("no-array-index-key", getDoubleRuleSeverity(NO_ARRAY_INDEX_KEY_SEVERITY, true)).addRule("no-children-count", getSeverity(noLegacyApis.Children)).addRule("no-children-for-each", getSeverity(noLegacyApis.Children)).addRule("no-children-map", getSeverity(noLegacyApis.Children)).addRule("no-children-only", getSeverity(noLegacyApis.Children)).addRule("no-children-prop", getDoubleRuleSeverity(NO_CHILDREN_PROP_SEVERITY, true)).addRule("no-children-to-array", getSeverity(noLegacyApis.Children)).addRule("no-class-component", getSeverity(noLegacyApis.classComponent ?? "warn")).addRule("no-clone-element", getSeverity(noLegacyApis.cloneElement)).addRule("no-component-will-mount", getSeverity(noLegacyApis.componentWillMount)).addRule("no-component-will-receive-props", getSeverity(noLegacyApis.componentWillReceiveProps)).addRule("no-component-will-update", getSeverity(noLegacyApis.componentWillUpdate)).addRule("no-context-provider", ERROR).addRule("no-create-ref", getSeverity(noLegacyApis.createRef)).addRule("no-default-props", isMinVersion19 ? ERROR : WARNING).addRule("no-direct-mutation-state", getDoubleRuleSeverity(NO_DIRECT_MUTATION_STATE_SEVERITY, true)).addRule("no-duplicate-key", getDoubleRuleSeverity(NO_DUPLICATE_OR_MISSING_KEY_SEVERITY, true)).addRule("no-forward-ref", getSeverity(noLegacyApis.forwardRef)).addRule("no-implicit-key", WARNING).addRule("no-missing-component-display-name", getDoubleRuleSeverity(NO_MISSING_COMPONENT_OR_CONTEXT_DISPLAY_NAME_SEVERITY, true)).addRule("no-missing-context-display-name", getDoubleRuleSeverity(NO_MISSING_COMPONENT_OR_CONTEXT_DISPLAY_NAME_SEVERITY, true)).addRule("no-missing-key", getDoubleRuleSeverity(NO_DUPLICATE_OR_MISSING_KEY_SEVERITY, true)).addRule("no-misused-capture-owner-stack", ERROR).addRule("no-nested-component-definitions", getDoubleRuleSeverity(NO_NESTED_COMPONENT_DEFINITIONS_SEVERITY, true)).addRule("no-nested-lazy-component-declarations", ERROR).addRule("no-prop-types", isMinVersion19 ? ERROR : WARNING).addRule("no-redundant-should-component-update", getDoubleRuleSeverity(NO_REDUNDANT_SHOULD_COMPONENT_UPDATE_SEVERITY, true)).addRule("no-set-state-in-component-did-mount", getDoubleRuleSeverity(NO_SET_STATE_IN_COMPONENT_DID_MOUNT_SEVERITY, true)).addRule("no-set-state-in-component-did-update", getDoubleRuleSeverity(NO_SET_STATE_IN_COMPONENT_DID_UPDATE_SEVERITY, true)).addRule("no-set-state-in-component-will-update", getDoubleRuleSeverity(NO_SET_STATE_IN_COMPONENT_WILL_UPDATE_SEVERITY, true)).addRule("no-string-refs", getDoubleRuleSeverity(NO_STRING_REFS_SEVERITY, true)).addRule("no-unnecessary-key", ERROR).addRule("no-unsafe-component-will-mount", getDoubleRuleSeverity(noUnsafeClassComponentMethodsSeverity, true)).addRule("no-unsafe-component-will-receive-props", getDoubleRuleSeverity(noUnsafeClassComponentMethodsSeverity, true)).addRule("no-unsafe-component-will-update", getDoubleRuleSeverity(noUnsafeClassComponentMethodsSeverity, true)).addRule("no-unstable-context-value", getDoubleRuleSeverity(NO_UNSTABLE_CONTEXT_VALUE_SEVERITY, true)).addRule("no-unstable-default-props", getDoubleRuleSeverity(NO_UNSTABLE_DEFAULT_PROPS_SEVERITY, true)).addRule("no-unused-class-component-members", getDoubleRuleSeverity(NO_UNUSED_CLASS_COMPONENT_MEMBERS_SEVERITY, true)).addRule("no-unused-state", getDoubleRuleSeverity(NO_UNUSED_STATE_SEVERITY, true)).addRule("no-use-context", WARNING).addRule("no-useless-forward-ref", getDoubleRuleSeverity(NO_USELESS_FORWARD_REF_SEVERITY, true)).addRule("no-useless-fragment", getDoubleRuleSeverity(NO_USELESS_FRAGMENT_SEVERITY, true)).addRule("prefer-destructuring-assignment", getDoubleRuleSeverity(PREFER_DESTRUCTURING_ASSIGNMENT_SEVERITY, true)).addRule("prefer-namespace-import", OFF).markCategory("Naming Convention").addAnyRule("@eslint-react/naming-convention", "component-name", getDoubleRuleSeverity(COMPONENT_NAME_SEVERITY, true)).addAnyRule("@eslint-react/naming-convention", "context-name", WARNING).addAnyRule("@eslint-react/naming-convention", "filename", OFF).addAnyRule("@eslint-react/naming-convention", "filename-extension", getDoubleRuleSeverity(FILENAME_EXTENSION_SEVERITY, true), [{
|
|
210
210
|
allow: "always",
|
|
211
211
|
extensions: JSX_FILE_EXTENSIONS
|
|
212
|
-
}]).addAnyRule("@eslint-react/naming-convention", "use-state", getDoubleRuleSeverity(USE_STATE_SEVERITY, true)).markCategory("Debug").addAnyRule("@eslint-react/debug", "class-component", OFF).addAnyRule("@eslint-react/debug", "function-component", OFF).addAnyRule("@eslint-react/debug", "hook", OFF).addAnyRule("@eslint-react/debug", "is-from-react", OFF).addAnyRule("@eslint-react/debug", "jsx", OFF).enableConfigTesterForPlugin("@eslint-react", { rulesToSkipInConfig: (ruleName) => REACT_X_TYPE_AWARE_RULES.has(ruleName) || REACT_X_HOOKS_RULES.has(ruleName) }).addOverrides();
|
|
212
|
+
}]).addAnyRule("@eslint-react/naming-convention", "use-state", getDoubleRuleSeverity(USE_STATE_SEVERITY, true), [{ enforceAssignment: true }]).addAnyRule("@eslint-react/naming-convention", "ref-name", ERROR).markCategory("Debug").addAnyRule("@eslint-react/debug", "class-component", OFF).addAnyRule("@eslint-react/debug", "function-component", OFF).addAnyRule("@eslint-react/debug", "hook", OFF).addAnyRule("@eslint-react/debug", "is-from-react", OFF).addAnyRule("@eslint-react/debug", "jsx", OFF).enableConfigTesterForPlugin("@eslint-react", { rulesToSkipInConfig: (ruleName) => REACT_X_TYPE_AWARE_RULES.has(ruleName) || REACT_X_HOOKS_RULES.has(ruleName) }).addOverrides();
|
|
213
213
|
const configBuilderReactXTypeAware = context.createConfigBuilder(tsFilesTypeAware.length === 0 ? false : configReactXTypeAwareRules, "@eslint-react");
|
|
214
214
|
configBuilderReactXTypeAware?.addConfig(["react/x/rules-type-aware", {
|
|
215
215
|
includeDefaultFilesAndIgnores: true,
|
|
@@ -22,7 +22,7 @@ var stylistic_default = (async (context, optionsRaw) => {
|
|
|
22
22
|
Array.isArray(customizedRuleEntry) ? customizedRuleEntry.slice(1) : options || []
|
|
23
23
|
];
|
|
24
24
|
};
|
|
25
|
-
configBuilder?.addConfig(["stylistic", { includeDefaultFilesAndIgnores: true }]).addRule(...setupRule("array-bracket-newline", OFF)).addRule(...setupRule("array-bracket-spacing", OFF)).addRule(...setupRule("array-element-newline", OFF)).addRule(...setupRule("arrow-parens", OFF)).addRule(...setupRule("arrow-spacing", OFF)).addRule(...setupRule("block-spacing", OFF)).addRule(...setupRule("brace-style", OFF)).addRule(...setupRule("comma-dangle", OFF)).addRule(...setupRule("comma-spacing", OFF)).addRule(...setupRule("comma-style", OFF)).addRule(...setupRule("computed-property-spacing", OFF)).addRule(...setupRule("curly-newline", OFF)).addRule(...setupRule("dot-location", OFF)).addRule(...setupRule("eol-last", OFF)).addRule(...setupRule("exp-list-style", OFF)).addRule(...setupRule("function-call-argument-newline", OFF)).addRule(...setupRule("function-call-spacing", OFF)).addRule(...setupRule("function-paren-newline", OFF)).addRule(...setupRule("generator-star-spacing", OFF)).addRule(...setupRule("implicit-arrow-linebreak", OFF)).addRule(...setupRule("indent", OFF)).addRule(...setupRule("indent-binary-ops", OFF)).addRule(...setupRule("jsx-child-element-spacing", OFF)).addRule(...setupRule("jsx-closing-bracket-location", OFF)).addRule(...setupRule("jsx-closing-tag-location", OFF)).addRule(...setupRule("jsx-curly-brace-presence", OFF)).addRule(...setupRule("jsx-curly-newline", OFF)).addRule(...setupRule("jsx-curly-spacing", OFF)).addRule(...setupRule("jsx-equals-spacing", OFF)).addRule(...setupRule("jsx-first-prop-new-line", OFF)).addRule(...setupRule("jsx-function-call-newline", OFF)).addRule(...setupRule("jsx-indent-props", OFF)).addRule(...setupRule("jsx-max-props-per-line", OFF)).addRule(...setupRule("jsx-newline", OFF)).addRule(...setupRule("jsx-one-expression-per-line", OFF)).addRule(...setupRule("jsx-pascal-case", OFF)).addRule(...setupRule("jsx-quotes", OFF)).addRule(...setupRule("jsx-self-closing-comp", OFF)).addRule(...setupRule("jsx-
|
|
25
|
+
configBuilder?.addConfig(["stylistic", { includeDefaultFilesAndIgnores: true }]).addRule(...setupRule("array-bracket-newline", OFF)).addRule(...setupRule("array-bracket-spacing", OFF)).addRule(...setupRule("array-element-newline", OFF)).addRule(...setupRule("arrow-parens", OFF)).addRule(...setupRule("arrow-spacing", OFF)).addRule(...setupRule("block-spacing", OFF)).addRule(...setupRule("brace-style", OFF)).addRule(...setupRule("comma-dangle", OFF)).addRule(...setupRule("comma-spacing", OFF)).addRule(...setupRule("comma-style", OFF)).addRule(...setupRule("computed-property-spacing", OFF)).addRule(...setupRule("curly-newline", OFF)).addRule(...setupRule("dot-location", OFF)).addRule(...setupRule("eol-last", OFF)).addRule(...setupRule("exp-list-style", OFF)).addRule(...setupRule("function-call-argument-newline", OFF)).addRule(...setupRule("function-call-spacing", OFF)).addRule(...setupRule("function-paren-newline", OFF)).addRule(...setupRule("generator-star-spacing", OFF)).addRule(...setupRule("implicit-arrow-linebreak", OFF)).addRule(...setupRule("indent", OFF)).addRule(...setupRule("indent-binary-ops", OFF)).addRule(...setupRule("jsx-child-element-spacing", OFF)).addRule(...setupRule("jsx-closing-bracket-location", OFF)).addRule(...setupRule("jsx-closing-tag-location", OFF)).addRule(...setupRule("jsx-curly-brace-presence", OFF)).addRule(...setupRule("jsx-curly-newline", OFF)).addRule(...setupRule("jsx-curly-spacing", OFF)).addRule(...setupRule("jsx-equals-spacing", OFF)).addRule(...setupRule("jsx-first-prop-new-line", OFF)).addRule(...setupRule("jsx-function-call-newline", OFF)).addRule(...setupRule("jsx-indent-props", OFF)).addRule(...setupRule("jsx-max-props-per-line", OFF)).addRule(...setupRule("jsx-newline", OFF)).addRule(...setupRule("jsx-one-expression-per-line", OFF)).addRule(...setupRule("jsx-pascal-case", OFF)).addRule(...setupRule("jsx-quotes", OFF)).addRule(...setupRule("jsx-self-closing-comp", OFF)).addRule(...setupRule("jsx-tag-spacing", OFF)).addRule(...setupRule("jsx-wrap-multilines", OFF)).addRule(...setupRule("key-spacing", OFF)).addRule(...setupRule("keyword-spacing", OFF)).addRule(...setupRule("line-comment-position", OFF)).addRule(...setupRule("linebreak-style", OFF)).addRule(...setupRule("lines-around-comment", OFF)).addRule(...setupRule("lines-between-class-members", OFF)).addRule(...setupRule("max-len", OFF)).addRule(...setupRule("max-statements-per-line", OFF)).addRule(...setupRule("member-delimiter-style", OFF)).addRule(...setupRule("multiline-comment-style", OFF)).addRule(...setupRule("multiline-ternary", OFF)).addRule(...setupRule("new-parens", OFF)).addRule(...setupRule("newline-per-chained-call", OFF)).addRule(...setupRule("no-confusing-arrow", OFF)).addRule(...setupRule("no-extra-parens", OFF)).addRule(...setupRule("no-extra-semi", OFF)).addRule(...setupRule("no-floating-decimal", OFF)).addRule(...setupRule("no-mixed-operators", OFF)).addRule(...setupRule("no-mixed-spaces-and-tabs", OFF)).addRule(...setupRule("no-multi-spaces", OFF)).addRule(...setupRule("no-multiple-empty-lines", OFF)).addRule(...setupRule("no-tabs", OFF)).addRule(...setupRule("no-trailing-spaces", OFF)).addRule(...setupRule("no-whitespace-before-property", OFF)).addRule(...setupRule("nonblock-statement-body-position", OFF)).addRule(...setupRule("object-curly-newline", OFF)).addRule(...setupRule("object-curly-spacing", OFF)).addRule(...setupRule("object-property-newline", OFF)).addRule(...setupRule("one-var-declaration-per-line", OFF)).addRule(...setupRule("operator-linebreak", OFF)).addRule(...setupRule("padded-blocks", OFF)).addRule(...setupRule("padding-line-between-statements", ERROR, [{
|
|
26
26
|
blankLine: "never",
|
|
27
27
|
prev: "import",
|
|
28
28
|
next: "import"
|
package/dist/configs/ts.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ObjectValues, OmitStrict } from "../types.mjs";
|
|
2
|
-
import { MaybeFn } from "../utils.mjs";
|
|
3
2
|
import "./astro.mjs";
|
|
3
|
+
import { MaybeFn } from "../utils.mjs";
|
|
4
4
|
import "./vue.mjs";
|
|
5
5
|
import "./svelte.mjs";
|
|
6
6
|
import "./index.mjs";
|
|
@@ -30,8 +30,8 @@ declare const TSCONFIG_COMPILER_OPTIONS_KEYS: {
|
|
|
30
30
|
type TsconfigCompilerOptionsGroups = keyof typeof TSCONFIG_COMPILER_OPTIONS_KEYS;
|
|
31
31
|
type TsconfigCompilerOptionsKeys = ObjectValues<typeof TSCONFIG_COMPILER_OPTIONS_KEYS>[number];
|
|
32
32
|
declare const TSCONFIG_COMPILER_OPTIONS_ORDER_PRESETS: {
|
|
33
|
-
antfu: ("
|
|
34
|
-
totalTypescript: ("
|
|
33
|
+
antfu: ("erasableSyntaxOnly" | "module" | "strict" | "jsx" | "types" | "rootDir" | "declaration" | "allowUnreachableCode" | "allowUnusedLabels" | "alwaysStrict" | "exactOptionalPropertyTypes" | "noFallthroughCasesInSwitch" | "noImplicitAny" | "noImplicitOverride" | "noImplicitReturns" | "noImplicitThis" | "noPropertyAccessFromIndexSignature" | "noUncheckedIndexedAccess" | "noUnusedLocals" | "noUnusedParameters" | "strictBindCallApply" | "strictFunctionTypes" | "strictNullChecks" | "strictPropertyInitialization" | "useUnknownInCatchVariables" | "allowArbitraryExtensions" | "allowImportingTsExtensions" | "allowUmdGlobalAccess" | "baseUrl" | "customConditions" | "moduleResolution" | "moduleSuffixes" | "noResolve" | "paths" | "resolveJsonModule" | "resolvePackageJsonExports" | "resolvePackageJsonImports" | "rootDirs" | "typeRoots" | "declarationDir" | "declarationMap" | "downlevelIteration" | "emitBOM" | "emitDeclarationOnly" | "importHelpers" | "importsNotUsedAsValues" | "inlineSourceMap" | "inlineSources" | "mapRoot" | "newLine" | "noEmit" | "noEmitHelpers" | "noEmitOnError" | "outDir" | "outFile" | "preserveConstEnums" | "preserveValueImports" | "removeComments" | "sourceMap" | "sourceRoot" | "stripInternal" | "allowJs" | "checkJs" | "maxNodeModuleJsDepth" | "allowSyntheticDefaultImports" | "esModuleInterop" | "forceConsistentCasingInFileNames" | "isolatedDeclarations" | "isolatedModules" | "preserveSymlinks" | "verbatimModuleSyntax" | "emitDecoratorMetadata" | "experimentalDecorators" | "jsxFactory" | "jsxFragmentFactory" | "jsxImportSource" | "lib" | "libReplacement" | "moduleDetection" | "noLib" | "reactNamespace" | "target" | "useDefineForClassFields" | "composite" | "disableReferencedProjectLoad" | "disableSolutionSearching" | "disableSourceOfProjectReferenceRedirect" | "incremental" | "tsBuildInfoFile" | "skipDefaultLibCheck" | "skipLibCheck")[];
|
|
34
|
+
totalTypescript: ("module" | "strict" | "declaration" | "noImplicitOverride" | "noUncheckedIndexedAccess" | "resolveJsonModule" | "declarationMap" | "noEmit" | "outDir" | "sourceMap" | "allowJs" | "esModuleInterop" | "isolatedModules" | "verbatimModuleSyntax" | "lib" | "moduleDetection" | "target" | "composite" | "skipLibCheck")[];
|
|
35
35
|
};
|
|
36
36
|
interface SortTsconfigKeysSubConfigOptions<ExtraPlugins extends ExtraPluginsType = never> extends UnConfigOptions<ExtraPlugins> {
|
|
37
37
|
/**
|
package/dist/configs/vitest.mjs
CHANGED
|
@@ -41,7 +41,7 @@ var vitest_default = (async (context, optionsRaw) => {
|
|
|
41
41
|
configBuilder?.addConfig(["vitest", {
|
|
42
42
|
includeDefaultFilesAndIgnores: true,
|
|
43
43
|
filesFallback: defaultVitestFiles
|
|
44
|
-
}], defaultVitestEslintConfig).addRule("consistent-each-for", enforceEachOrFor === false ? OFF : ERROR, enforceEachOrFor === false ? [] : [Object.fromEntries(FUNCTIONS_WITH_EACH_OR_FOR.map((fnName) => [fnName, typeof enforceEachOrFor === "string" ? enforceEachOrFor : enforceEachOrFor[fnName] ?? enforceEachOrFor.default]))]).addRule("consistent-test-filename", OFF).addRule("consistent-test-it", optionsResolved.testDefinitionKeyword === false ? OFF : ERROR, generateConsistentTestItOptions(optionsResolved)).addRule("consistent-vitest-vi", ERROR).addRule("expect-expect", ERROR).addRule("hoisted-apis-on-top", ERROR).addRule("max-expects", maxAssertionCalls == null ? OFF : ERROR, [{ max: maxAssertionCalls }]).addRule("max-nested-describe", maxNestedDescribes == null ? OFF : ERROR, [{ max: maxNestedDescribes }]).addRule("no-alias-methods", ERROR).addRule("no-commented-out-tests", WARNING).addRule("no-conditional-expect", ERROR).addRule("no-conditional-in-test", OFF).addRule("no-conditional-tests", ERROR).addRule("no-disabled-tests", WARNING).addRule("no-duplicate-hooks", ERROR).addRule("no-focused-tests", ERROR).addRule("no-hooks", OFF).addRule("no-identical-title", ERROR).addRule("no-import-node-test", ERROR).addRule("no-importing-vitest-globals", vitestGlobalsImporting === "disallow" ? ERROR : OFF).addRule("no-interpolation-in-snapshots", ERROR).addRule("no-large-snapshots", OFF).addRule("no-mocks-import", ERROR).addRule("no-restricted-matchers", hasRestrictedMatchers ? ERROR : OFF, [restrictedMatchers || {}]).addRule("no-restricted-vi-methods", hasRestrictedMethods ? ERROR : OFF, [restrictedMethods || {}]).addRule("no-standalone-expect", ERROR).addRule("no-test-prefixes", ERROR).addRule("no-test-return-statement", ERROR).addRule("no-unneeded-async-expect-function", ERROR).addRule("padding-around-after-all-blocks", getPaddingAroundSeverity("afterAll")).addRule("padding-around-after-each-blocks", getPaddingAroundSeverity("afterEach")).addRule("padding-around-all", OFF).addRule("padding-around-before-all-blocks", getPaddingAroundSeverity("beforeAll")).addRule("padding-around-before-each-blocks", getPaddingAroundSeverity("beforeEach")).addRule("padding-around-describe-blocks", getPaddingAroundSeverity("describe")).addRule("padding-around-expect-groups", getPaddingAroundSeverity("expect")).addRule("padding-around-test-blocks", getPaddingAroundSeverity("test")).addRule("prefer-called-exactly-once-with", (vitestMajorVersion || 0) >= 3 ? ERROR : OFF).addRule("prefer-called-once", enforceToBeCalledStyle === "once" ? ERROR : OFF).addRule("prefer-called-times", enforceToBeCalledStyle === "times" ? ERROR : OFF).addRule("prefer-called-with", OFF).addRule("prefer-comparison-matcher", ERROR).addRule("prefer-describe-function-title", OFF).addRule("prefer-each", WARNING).addRule("prefer-equality-matcher", ERROR).addRule("prefer-expect-assertions", OFF).addRule("prefer-expect-resolves", ERROR).addRule("prefer-expect-type-of", ERROR).addRule("prefer-hooks-in-order", ERROR).addRule("prefer-hooks-on-top", ERROR).addRule("prefer-import-in-mock", ERROR).addRule("prefer-importing-vitest-globals", vitestGlobalsImporting === "enforce" ? ERROR : OFF).addRule("prefer-lowercase-title", ERROR).addRule("prefer-mock-promise-shorthand", ERROR).addRule("prefer-snapshot-hint", OFF).addRule("prefer-spy-on", ERROR).addRule("prefer-strict-boolean-matchers", OFF).addRule("prefer-strict-equal", WARNING).addRule("prefer-to-be", ERROR).addRule("prefer-to-be-falsy", OFF).addRule("prefer-to-be-object", ERROR).addRule("prefer-to-be-truthy", OFF).addRule("prefer-to-contain", ERROR).addRule("prefer-to-have-been-called-times", ERROR).addRule("prefer-to-have-length", ERROR).addRule("prefer-todo", WARNING).addRule("require-awaited-expect-poll", WARNING).addRule("require-hook", WARNING).addRule("require-local-test-context-for-concurrent-snapshots", ERROR).addRule("require-mock-type-parameters", WARNING).addRule("require-to-throw-message", OFF).addRule("require-top-level-describe", OFF).addRule("valid-describe-callback", ERROR).addRule("valid-expect", ERROR, [{
|
|
44
|
+
}], defaultVitestEslintConfig).addRule("consistent-each-for", enforceEachOrFor === false ? OFF : ERROR, enforceEachOrFor === false ? [] : [Object.fromEntries(FUNCTIONS_WITH_EACH_OR_FOR.map((fnName) => [fnName, typeof enforceEachOrFor === "string" ? enforceEachOrFor : enforceEachOrFor[fnName] ?? enforceEachOrFor.default]))]).addRule("consistent-test-filename", OFF).addRule("consistent-test-it", optionsResolved.testDefinitionKeyword === false ? OFF : ERROR, generateConsistentTestItOptions(optionsResolved)).addRule("consistent-vitest-vi", ERROR).addRule("expect-expect", ERROR).addRule("hoisted-apis-on-top", ERROR).addRule("max-expects", maxAssertionCalls == null ? OFF : ERROR, [{ max: maxAssertionCalls }]).addRule("max-nested-describe", maxNestedDescribes == null ? OFF : ERROR, [{ max: maxNestedDescribes }]).addRule("no-alias-methods", ERROR).addRule("no-commented-out-tests", WARNING).addRule("no-conditional-expect", ERROR, [{ expectAssertions: true }]).addRule("no-conditional-in-test", OFF).addRule("no-conditional-tests", ERROR).addRule("no-disabled-tests", WARNING).addRule("no-duplicate-hooks", ERROR).addRule("no-focused-tests", ERROR).addRule("no-hooks", OFF).addRule("no-identical-title", ERROR).addRule("no-import-node-test", ERROR).addRule("no-importing-vitest-globals", vitestGlobalsImporting === "disallow" ? ERROR : OFF).addRule("no-interpolation-in-snapshots", ERROR).addRule("no-large-snapshots", OFF).addRule("no-mocks-import", ERROR).addRule("no-restricted-matchers", hasRestrictedMatchers ? ERROR : OFF, [restrictedMatchers || {}]).addRule("no-restricted-vi-methods", hasRestrictedMethods ? ERROR : OFF, [restrictedMethods || {}]).addRule("no-standalone-expect", ERROR).addRule("no-test-prefixes", ERROR).addRule("no-test-return-statement", ERROR).addRule("no-unneeded-async-expect-function", ERROR).addRule("padding-around-after-all-blocks", getPaddingAroundSeverity("afterAll")).addRule("padding-around-after-each-blocks", getPaddingAroundSeverity("afterEach")).addRule("padding-around-all", OFF).addRule("padding-around-before-all-blocks", getPaddingAroundSeverity("beforeAll")).addRule("padding-around-before-each-blocks", getPaddingAroundSeverity("beforeEach")).addRule("padding-around-describe-blocks", getPaddingAroundSeverity("describe")).addRule("padding-around-expect-groups", getPaddingAroundSeverity("expect")).addRule("padding-around-test-blocks", getPaddingAroundSeverity("test")).addRule("prefer-called-exactly-once-with", (vitestMajorVersion || 0) >= 3 ? ERROR : OFF).addRule("prefer-called-once", enforceToBeCalledStyle === "once" ? ERROR : OFF).addRule("prefer-called-times", enforceToBeCalledStyle === "times" ? ERROR : OFF).addRule("prefer-called-with", OFF).addRule("prefer-comparison-matcher", ERROR).addRule("prefer-describe-function-title", OFF).addRule("prefer-each", WARNING).addRule("prefer-equality-matcher", ERROR).addRule("prefer-expect-assertions", OFF).addRule("prefer-expect-resolves", ERROR).addRule("prefer-expect-type-of", ERROR).addRule("prefer-hooks-in-order", ERROR).addRule("prefer-hooks-on-top", ERROR).addRule("prefer-import-in-mock", ERROR, [{ fixable: false }]).addRule("prefer-importing-vitest-globals", vitestGlobalsImporting === "enforce" ? ERROR : OFF).addRule("prefer-lowercase-title", ERROR).addRule("prefer-mock-promise-shorthand", ERROR).addRule("prefer-mock-return-shorthand", ERROR).addRule("prefer-snapshot-hint", OFF).addRule("prefer-spy-on", ERROR).addRule("prefer-strict-boolean-matchers", OFF).addRule("prefer-strict-equal", WARNING).addRule("prefer-to-be", ERROR).addRule("prefer-to-be-falsy", OFF).addRule("prefer-to-be-object", ERROR).addRule("prefer-to-be-truthy", OFF).addRule("prefer-to-contain", ERROR).addRule("prefer-to-have-been-called-times", ERROR).addRule("prefer-to-have-length", ERROR).addRule("prefer-todo", WARNING).addRule("require-awaited-expect-poll", WARNING).addRule("require-hook", WARNING).addRule("require-local-test-context-for-concurrent-snapshots", ERROR).addRule("require-mock-type-parameters", WARNING).addRule("require-test-timeout", OFF).addRule("require-to-throw-message", OFF).addRule("require-top-level-describe", OFF).addRule("valid-describe-callback", ERROR).addRule("valid-expect", ERROR, [{
|
|
45
45
|
alwaysAwait: true,
|
|
46
46
|
...asyncMatchers?.length && { asyncMatchers },
|
|
47
47
|
...minAndMaxExpectArgs?.[0] != null && minAndMaxExpectArgs[0] >= 0 && { minArgs: minAndMaxExpectArgs[0] },
|
|
@@ -198,6 +198,7 @@ const ALL_RULES_PER_PLUGIN = {
|
|
|
198
198
|
"context-name",
|
|
199
199
|
"filename",
|
|
200
200
|
"filename-extension",
|
|
201
|
+
"ref-name",
|
|
201
202
|
"use-state"
|
|
202
203
|
],
|
|
203
204
|
"@eslint-react/web-api": [
|
|
@@ -1114,6 +1115,7 @@ const ALL_RULES_PER_PLUGIN = {
|
|
|
1114
1115
|
"no-deprecated-context-methods",
|
|
1115
1116
|
"no-deprecated-report-api",
|
|
1116
1117
|
"no-identical-tests",
|
|
1118
|
+
"no-matching-violation-suggest-message-ids",
|
|
1117
1119
|
"no-meta-replaced-by",
|
|
1118
1120
|
"no-meta-schema-default",
|
|
1119
1121
|
"no-missing-message-ids",
|
|
@@ -1900,6 +1902,8 @@ const ALL_RULES_PER_PLUGIN = {
|
|
|
1900
1902
|
"require-name",
|
|
1901
1903
|
"require-optionalDependencies",
|
|
1902
1904
|
"require-peerDependencies",
|
|
1905
|
+
"require-repository",
|
|
1906
|
+
"require-scripts",
|
|
1903
1907
|
"require-sideEffects",
|
|
1904
1908
|
"require-type",
|
|
1905
1909
|
"require-types",
|
|
@@ -3209,6 +3213,7 @@ const ALL_RULES_PER_PLUGIN = {
|
|
|
3209
3213
|
"prefer-importing-vitest-globals",
|
|
3210
3214
|
"prefer-lowercase-title",
|
|
3211
3215
|
"prefer-mock-promise-shorthand",
|
|
3216
|
+
"prefer-mock-return-shorthand",
|
|
3212
3217
|
"prefer-snapshot-hint",
|
|
3213
3218
|
"prefer-spy-on",
|
|
3214
3219
|
"prefer-strict-boolean-matchers",
|
|
@@ -3224,6 +3229,7 @@ const ALL_RULES_PER_PLUGIN = {
|
|
|
3224
3229
|
"prefer-vi-mocked",
|
|
3225
3230
|
"require-awaited-expect-poll",
|
|
3226
3231
|
"require-hook",
|
|
3232
|
+
"require-test-timeout",
|
|
3227
3233
|
"require-local-test-context-for-concurrent-snapshots",
|
|
3228
3234
|
"require-mock-type-parameters",
|
|
3229
3235
|
"require-to-throw-message",
|