@shayanthenerd/eslint-config 0.32.0 → 0.33.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.
- package/README.md +62 -38
- package/dist/configs/astro.mjs +5 -1
- package/dist/configs/packageJson.mjs +1 -1
- package/dist/configs/react.mjs +2 -2
- package/dist/configs/tailwind.mjs +7 -1
- package/dist/configs/typescript.mjs +4 -6
- package/dist/helpers/ignores/defaultIgnorePatterns.mjs +1 -6
- package/dist/helpers/options/defaultOptions.mjs +13 -3
- package/dist/helpers/options/enableDetectedConfigs.mjs +18 -7
- package/dist/index.d.mts +1 -0
- package/dist/rules/astro.mjs +61 -54
- package/dist/rules/baseline.mjs +1 -1
- package/dist/rules/css.mjs +35 -7
- package/dist/rules/html.mjs +3 -2
- package/dist/rules/importX.mjs +2 -2
- package/dist/rules/javascript.mjs +6 -5
- package/dist/rules/next.mjs +2 -0
- package/dist/rules/node.mjs +1 -1
- package/dist/rules/packageJson.mjs +166 -153
- package/dist/rules/perfectionist.mjs +41 -11
- package/dist/rules/playwright.mjs +10 -0
- package/dist/rules/react.mjs +57 -54
- package/dist/rules/stylistic.mjs +1 -1
- package/dist/rules/tanstack.mjs +1 -1
- package/dist/rules/typescript.mjs +2 -2
- package/dist/rules/unicorn.mjs +15 -6
- package/dist/rules/vue.mjs +38 -41
- package/dist/rules/zod.mjs +2 -0
- package/dist/types/eslint-schema.d.mts +776 -651
- package/dist/types/index.d.mts +50 -7
- package/dist/types/options/baseline.d.mts +24 -3
- package/dist/types/options/react.d.mts +9 -9
- package/dist/types/options/typescript.d.mts +3 -3
- package/dist/types/options/vue.d.mts +1 -1
- package/package.json +34 -33
package/dist/rules/html.mjs
CHANGED
|
@@ -55,7 +55,7 @@ function getHtmlRules(options) {
|
|
|
55
55
|
"@html-eslint/require-input-label": "error",
|
|
56
56
|
"@html-eslint/require-meta-viewport": "error"
|
|
57
57
|
};
|
|
58
|
-
|
|
58
|
+
const stylisticRules = {
|
|
59
59
|
"@html-eslint/attrs-newline": ["warn", {
|
|
60
60
|
maxLen: maxLineLength,
|
|
61
61
|
ifAttrsMoreThan: maxAttributesPerLine
|
|
@@ -78,7 +78,8 @@ function getHtmlRules(options) {
|
|
|
78
78
|
"double",
|
|
79
79
|
{ enforceTemplatedAttrValue: true }
|
|
80
80
|
]
|
|
81
|
-
}
|
|
81
|
+
};
|
|
82
|
+
if (isEnabled(stylistic)) Object.assign(htmlRules, stylisticRules);
|
|
82
83
|
if (isEnabled(tailwind)) htmlRules["better-tailwindcss/no-duplicate-classes"] = "off";
|
|
83
84
|
if (isEnabled(unicorn)) htmlRules["unicorn/no-invalid-file-input-accept"] = "error";
|
|
84
85
|
return htmlRules;
|
package/dist/rules/importX.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { isEnabled } from "../utils/isEnabled.mjs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
//#region src/rules/importX.ts
|
|
4
4
|
function getImportXRules(options) {
|
|
5
|
-
const { packageDir, configs: { typescript } } = options;
|
|
5
|
+
const { packageDir, configs: { unicorn, typescript } } = options;
|
|
6
6
|
const isTypescriptEnabled = isEnabled(typescript);
|
|
7
7
|
return {
|
|
8
8
|
"import-x/export": isTypescriptEnabled ? "off" : "error",
|
|
@@ -15,7 +15,7 @@ function getImportXRules(options) {
|
|
|
15
15
|
"import-x/no-mutable-exports": "error",
|
|
16
16
|
"import-x/no-named-as-default": "error",
|
|
17
17
|
"import-x/no-amd": "error",
|
|
18
|
-
"import-x/no-commonjs": "error",
|
|
18
|
+
"import-x/no-commonjs": isEnabled(unicorn) ? "off" : "error",
|
|
19
19
|
"import-x/no-import-module-exports": "error",
|
|
20
20
|
"import-x/named": isTypescriptEnabled ? "off" : "error",
|
|
21
21
|
"import-x/default": isTypescriptEnabled ? "off" : "error",
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
2
2
|
//#region src/rules/javascript.ts
|
|
3
3
|
function getJavaScriptRules(options) {
|
|
4
|
-
const { unicorn, typescript, javascript: { maxDepth, maxNestedCallbacks } } = options.configs;
|
|
4
|
+
const { importX, unicorn, typescript, javascript: { maxDepth, maxNestedCallbacks } } = options.configs;
|
|
5
|
+
const isImportXEnabled = isEnabled(importX);
|
|
5
6
|
const isUnicornEnabled = isEnabled(unicorn);
|
|
6
7
|
const isTypescriptEnabled = isEnabled(typescript);
|
|
7
8
|
return {
|
|
@@ -26,7 +27,7 @@ function getJavaScriptRules(options) {
|
|
|
26
27
|
"no-dupe-class-members": isTypescriptEnabled ? "off" : "error",
|
|
27
28
|
"no-dupe-else-if": "error",
|
|
28
29
|
"no-dupe-keys": isTypescriptEnabled ? "off" : "error",
|
|
29
|
-
"no-duplicate-case": "error",
|
|
30
|
+
"no-duplicate-case": isImportXEnabled ? "off" : "error",
|
|
30
31
|
"no-duplicate-imports": ["error", {
|
|
31
32
|
includeExports: true,
|
|
32
33
|
allowSeparateTypeImports: true
|
|
@@ -190,7 +191,7 @@ function getJavaScriptRules(options) {
|
|
|
190
191
|
"no-useless-call": "error",
|
|
191
192
|
"no-useless-catch": "error",
|
|
192
193
|
"no-useless-computed-key": "error",
|
|
193
|
-
"no-useless-concat": "error",
|
|
194
|
+
"no-useless-concat": isUnicornEnabled ? "error" : "off",
|
|
194
195
|
"no-useless-constructor": "error",
|
|
195
196
|
"no-useless-escape": "error",
|
|
196
197
|
"no-useless-rename": "error",
|
|
@@ -200,7 +201,7 @@ function getJavaScriptRules(options) {
|
|
|
200
201
|
"no-with": "error",
|
|
201
202
|
"object-shorthand": "warn",
|
|
202
203
|
"operator-assignment": "warn",
|
|
203
|
-
"prefer-arrow-callback":
|
|
204
|
+
"prefer-arrow-callback": "warn",
|
|
204
205
|
"prefer-const": "error",
|
|
205
206
|
"prefer-destructuring": isTypescriptEnabled ? "off" : ["warn", {
|
|
206
207
|
object: true,
|
|
@@ -214,7 +215,7 @@ function getJavaScriptRules(options) {
|
|
|
214
215
|
"prefer-promise-reject-errors": isTypescriptEnabled ? "off" : ["warn", { allowEmptyReject: true }],
|
|
215
216
|
"prefer-regex-literals": ["warn", { disallowRedundantWrapping: true }],
|
|
216
217
|
"prefer-rest-params": "warn",
|
|
217
|
-
"prefer-spread": "warn",
|
|
218
|
+
"prefer-spread": isUnicornEnabled ? "warn" : "off",
|
|
218
219
|
"prefer-template": "warn",
|
|
219
220
|
"preserve-caught-error": "warn",
|
|
220
221
|
"radix": "warn",
|
package/dist/rules/next.mjs
CHANGED
|
@@ -4,6 +4,7 @@ const nextRules = {
|
|
|
4
4
|
"next/google-font-preconnect": "warn",
|
|
5
5
|
"next/inline-script-id": "error",
|
|
6
6
|
"next/next-script-for-ga": "warn",
|
|
7
|
+
"next/no-assign-module-variable": "error",
|
|
7
8
|
"next/no-async-client-component": "error",
|
|
8
9
|
"next/no-before-interactive-script-outside-document": "error",
|
|
9
10
|
"next/no-css-tags": "warn",
|
|
@@ -13,6 +14,7 @@ const nextRules = {
|
|
|
13
14
|
"next/no-head-import-in-document": "error",
|
|
14
15
|
"next/no-html-link-for-pages": "warn",
|
|
15
16
|
"next/no-img-element": "warn",
|
|
17
|
+
"next/no-location-assign-relative-destination": "error",
|
|
16
18
|
"next/no-page-custom-font": "warn",
|
|
17
19
|
"next/no-script-component-in-head": "error",
|
|
18
20
|
"next/no-styled-jsx-in-document": "error",
|
package/dist/rules/node.mjs
CHANGED
|
@@ -11,7 +11,7 @@ function getNodeRules(options) {
|
|
|
11
11
|
"n/no-path-concat": "error",
|
|
12
12
|
"n/no-process-env": ["error", { allowedVariables: ["NODE_ENV"] }],
|
|
13
13
|
"n/no-process-exit": "error",
|
|
14
|
-
"n/no-sync": "warn",
|
|
14
|
+
"n/no-sync": isEnabled(typescript) ? "warn" : "off",
|
|
15
15
|
"n/no-unpublished-import": "error",
|
|
16
16
|
"n/no-unsupported-features/es-builtins": "error",
|
|
17
17
|
"n/no-unsupported-features/es-syntax": "error",
|
|
@@ -1,157 +1,170 @@
|
|
|
1
|
+
import { defaultOptions } from "../helpers/options/defaultOptions.mjs";
|
|
2
|
+
import { isEnabled } from "../utils/isEnabled.mjs";
|
|
1
3
|
//#region src/rules/packageJson.ts
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
"
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
4
|
+
/**
|
|
5
|
+
Using a wildcard to target all objects within an array isn't supported yet.
|
|
6
|
+
@see https://github.com/michaelfaith/eslint-plugin-package-json/issues/1967
|
|
7
|
+
*/
|
|
8
|
+
const collectionSortPatterns = [
|
|
9
|
+
{
|
|
10
|
+
key: "author",
|
|
11
|
+
order: [
|
|
12
|
+
"name",
|
|
13
|
+
"email",
|
|
14
|
+
"url"
|
|
15
|
+
]
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
key: "bugs",
|
|
19
|
+
order: ["email", "url"]
|
|
20
|
+
},
|
|
21
|
+
"config",
|
|
22
|
+
"dependencies",
|
|
23
|
+
"devEngines",
|
|
24
|
+
"devDependencies",
|
|
25
|
+
"directories",
|
|
26
|
+
{
|
|
27
|
+
key: "dist",
|
|
28
|
+
order: ["shasum", "tarball"]
|
|
29
|
+
},
|
|
30
|
+
"engines",
|
|
31
|
+
"exports",
|
|
32
|
+
"husky",
|
|
33
|
+
"husky.hooks",
|
|
34
|
+
"lint-staged",
|
|
35
|
+
"nano-staged",
|
|
36
|
+
"optionalDependencies",
|
|
37
|
+
"overrides",
|
|
38
|
+
"peerDependencies",
|
|
39
|
+
"peerDependenciesMeta",
|
|
40
|
+
{
|
|
41
|
+
key: "repository",
|
|
42
|
+
order: [
|
|
43
|
+
"type",
|
|
44
|
+
"url",
|
|
45
|
+
"directory"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"release",
|
|
49
|
+
"simple-git-hooks"
|
|
50
|
+
];
|
|
51
|
+
function getPackageJsonRules(options) {
|
|
52
|
+
const { packageJson } = options.configs;
|
|
53
|
+
const { allowedDistTags: userUseAllowedDistTags, allowedDistTagsFor: userUseAllowedDistTagsFor } = isEnabled(packageJson) ? packageJson : defaultOptions.configs.packageJson;
|
|
54
|
+
return {
|
|
55
|
+
"package-json/bin-name-casing": "warn",
|
|
56
|
+
"package-json/exports-subpaths-style": ["warn", { prefer: "implicit" }],
|
|
57
|
+
"package-json/no-empty-fields": "error",
|
|
58
|
+
"package-json/no-local-dependencies": "error",
|
|
59
|
+
"package-json/no-redundant-files": "error",
|
|
60
|
+
"package-json/no-redundant-publishConfig": "error",
|
|
61
|
+
"package-json/order-properties": "warn",
|
|
62
|
+
"package-json/repository-shorthand": "warn",
|
|
63
|
+
"package-json/require-attribution": "warn",
|
|
64
|
+
"package-json/require-package-json-export": "error",
|
|
65
|
+
"package-json/require-bugs": "warn",
|
|
66
|
+
"package-json/require-description": ["warn", { ignorePrivate: true }],
|
|
67
|
+
"package-json/require-devEngines": "warn",
|
|
68
|
+
"package-json/require-engines": ["warn", { ignorePrivate: true }],
|
|
69
|
+
"package-json/require-exports": ["error", { ignorePrivate: true }],
|
|
70
|
+
"package-json/require-files": ["error", { ignorePrivate: true }],
|
|
71
|
+
"package-json/require-homepage": "warn",
|
|
72
|
+
"package-json/require-keywords": "warn",
|
|
73
|
+
"package-json/require-license": ["error", { ignorePrivate: true }],
|
|
74
|
+
"package-json/require-name": "error",
|
|
75
|
+
"package-json/require-repository": "warn",
|
|
76
|
+
"package-json/require-type": "warn",
|
|
77
|
+
"package-json/require-types": ["error", { ignorePrivate: true }],
|
|
78
|
+
"package-json/require-version": "error",
|
|
79
|
+
"package-json/restrict-dependency-ranges": ["warn", [{
|
|
80
|
+
forDependencyTypes: ["dependencies", "devDependencies"],
|
|
81
|
+
rangeType: "pin"
|
|
82
|
+
}, {
|
|
83
|
+
forDependencyTypes: ["peerDependencies", "optionalDependencies"],
|
|
84
|
+
rangeType: ["caret", "tilde"]
|
|
85
|
+
}]],
|
|
86
|
+
"package-json/restrict-dist-tags": ["warn", {
|
|
87
|
+
allowed: userUseAllowedDistTags,
|
|
88
|
+
allowedFor: userUseAllowedDistTagsFor
|
|
89
|
+
}],
|
|
90
|
+
"package-json/restrict-private-properties": ["error", { blockedProperties: [
|
|
91
|
+
"files",
|
|
92
|
+
"publishConfig",
|
|
93
|
+
"keywords",
|
|
94
|
+
"funding"
|
|
95
|
+
] }],
|
|
96
|
+
"package-json/restrict-top-level-properties": ["warn", { ban: [
|
|
97
|
+
{
|
|
98
|
+
property: "bun",
|
|
99
|
+
message: "use bunfig.toml."
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
property: "pnpm",
|
|
103
|
+
message: "use pnpm-workspace.yaml."
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
property: "commitlint",
|
|
107
|
+
message: "use a dedicated config file."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
property: "stylelint",
|
|
111
|
+
message: "use a dedicated config file."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
property: "prettier",
|
|
115
|
+
message: "use a dedicated config file."
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
property: "renovate",
|
|
119
|
+
message: "use a dedicated config file."
|
|
120
|
+
}
|
|
121
|
+
] }],
|
|
122
|
+
"package-json/scripts-name-casing": "warn",
|
|
123
|
+
"package-json/sort-collections": ["warn", collectionSortPatterns],
|
|
124
|
+
"package-json/specify-peers-locally": "warn",
|
|
125
|
+
"package-json/unique-dependencies": "error",
|
|
126
|
+
"package-json/valid-author": "error",
|
|
127
|
+
"package-json/valid-bin": "error",
|
|
128
|
+
"package-json/valid-browser": "error",
|
|
129
|
+
"package-json/valid-bugs": "error",
|
|
130
|
+
"package-json/valid-bundleDependencies": "error",
|
|
131
|
+
"package-json/valid-config": "error",
|
|
132
|
+
"package-json/valid-contributors": "error",
|
|
133
|
+
"package-json/valid-cpu": "error",
|
|
134
|
+
"package-json/valid-dependencies": "error",
|
|
135
|
+
"package-json/valid-description": "error",
|
|
136
|
+
"package-json/valid-devDependencies": "error",
|
|
137
|
+
"package-json/valid-devEngines": "error",
|
|
138
|
+
"package-json/valid-directories": "error",
|
|
139
|
+
"package-json/valid-engines": "error",
|
|
140
|
+
"package-json/valid-exports": "error",
|
|
141
|
+
"package-json/valid-files": "error",
|
|
142
|
+
"package-json/valid-funding": "error",
|
|
143
|
+
"package-json/valid-gypfile": "error",
|
|
144
|
+
"package-json/valid-homepage": "error",
|
|
145
|
+
"package-json/valid-keywords": "error",
|
|
146
|
+
"package-json/valid-libc": "error",
|
|
147
|
+
"package-json/valid-license": "error",
|
|
148
|
+
"package-json/valid-main": "error",
|
|
149
|
+
"package-json/valid-man": "error",
|
|
150
|
+
"package-json/valid-module": "error",
|
|
151
|
+
"package-json/valid-name": "error",
|
|
152
|
+
"package-json/valid-optionalDependencies": "error",
|
|
153
|
+
"package-json/valid-os": "error",
|
|
154
|
+
"package-json/valid-packageManager": "error",
|
|
155
|
+
"package-json/valid-peerDependencies": "error",
|
|
156
|
+
"package-json/valid-peerDependenciesMeta": "error",
|
|
157
|
+
"package-json/valid-peerDependenciesMeta-relationship": "error",
|
|
158
|
+
"package-json/valid-private": "error",
|
|
159
|
+
"package-json/valid-publishConfig": "error",
|
|
160
|
+
"package-json/valid-repository": "error",
|
|
161
|
+
"package-json/valid-repository-directory": "error",
|
|
162
|
+
"package-json/valid-scripts": "error",
|
|
163
|
+
"package-json/valid-sideEffects": "error",
|
|
164
|
+
"package-json/valid-type": "error",
|
|
165
|
+
"package-json/valid-version": "error",
|
|
166
|
+
"package-json/valid-workspaces": "error"
|
|
167
|
+
};
|
|
155
168
|
}
|
|
156
169
|
//#endregion
|
|
157
170
|
export { getPackageJsonRules };
|
|
@@ -69,20 +69,47 @@ const sortArrayIncludesOptions = {
|
|
|
69
69
|
"unknown"
|
|
70
70
|
]
|
|
71
71
|
};
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
72
|
+
const componentPattern = ["\\.([jt]sx|astro|vue)$"];
|
|
73
|
+
const sortImportsCustomGroups = [
|
|
74
|
+
{
|
|
75
|
+
groupName: "component-subpath",
|
|
76
|
+
elementNamePattern: componentPattern,
|
|
77
|
+
modifiers: ["value"],
|
|
78
|
+
selector: "subpath"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
groupName: "component-tsconfig-path",
|
|
82
|
+
elementNamePattern: componentPattern,
|
|
83
|
+
modifiers: ["value"],
|
|
84
|
+
selector: "tsconfig-path"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
groupName: "component-internal",
|
|
88
|
+
elementNamePattern: componentPattern,
|
|
89
|
+
modifiers: ["value"],
|
|
90
|
+
selector: "internal"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
groupName: "component",
|
|
94
|
+
elementNamePattern: componentPattern,
|
|
95
|
+
modifiers: ["value"]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
groupName: "image",
|
|
99
|
+
elementNamePattern: ["\\.(apng|avif|bmp|gif|heic|heif|ico|jfif|jpe?g|jxl|pjpeg|png|svgz?|tiff?|webp)$"]
|
|
100
|
+
}
|
|
101
|
+
];
|
|
80
102
|
const sortImportsGroups = [
|
|
81
103
|
["style", "side-effect-style"],
|
|
82
104
|
{ newlinesBetween: 0 },
|
|
83
105
|
"side-effect",
|
|
84
106
|
"image",
|
|
85
|
-
|
|
107
|
+
[
|
|
108
|
+
"component-subpath",
|
|
109
|
+
"component-tsconfig-path",
|
|
110
|
+
"component-internal",
|
|
111
|
+
"component"
|
|
112
|
+
],
|
|
86
113
|
"type-external",
|
|
87
114
|
{ newlinesBetween: 0 },
|
|
88
115
|
"type-builtin",
|
|
@@ -98,10 +125,13 @@ const sortImportsGroups = [
|
|
|
98
125
|
"external",
|
|
99
126
|
{ newlinesBetween: 0 },
|
|
100
127
|
"builtin",
|
|
101
|
-
[
|
|
128
|
+
[
|
|
129
|
+
"subpath",
|
|
130
|
+
"tsconfig-path",
|
|
131
|
+
"internal"
|
|
132
|
+
],
|
|
102
133
|
{ newlinesBetween: 0 },
|
|
103
134
|
[
|
|
104
|
-
"internal",
|
|
105
135
|
"parent",
|
|
106
136
|
"index",
|
|
107
137
|
"sibling"
|
|
@@ -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",
|