@wistia/oxlint-config 0.2.0 → 0.3.1
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/configs/javascript.mjs +13 -0
- package/configs/node.mjs +8 -0
- package/configs/playwright.mjs +7 -0
- package/configs/react.mjs +11 -0
- package/configs/storybook.mjs +7 -0
- package/configs/styled-components.mjs +7 -0
- package/configs/testing-library.mjs +7 -0
- package/configs/typescript.mjs +20 -0
- package/configs/vitest.mjs +8 -0
- package/index.mjs +24 -0
- package/package.json +10 -16
- package/rules/{base.jsonc → base.mjs} +179 -184
- package/rules/{import.jsonc → import.mjs} +30 -32
- package/rules/{node.jsonc → node.mjs} +37 -39
- package/rules/{playwright.jsonc → playwright.mjs} +52 -54
- package/rules/{promise.jsonc → promise.mjs} +20 -22
- package/rules/{react-a11y.jsonc → react-a11y.mjs} +48 -50
- package/rules/{react.jsonc → react.mjs} +55 -57
- package/rules/{storybook.jsonc → storybook.mjs} +20 -22
- package/rules/styled-components.mjs +151 -0
- package/rules/{testing-library.jsonc → testing-library.mjs} +48 -50
- package/rules/{typescript.jsonc → typescript.mjs} +134 -136
- package/rules/{vitest.jsonc → vitest.mjs} +87 -89
- package/configs/javascript.jsonc +0 -4
- package/configs/node.jsonc +0 -4
- package/configs/playwright.jsonc +0 -4
- package/configs/react.jsonc +0 -4
- package/configs/storybook.jsonc +0 -4
- package/configs/styled-components.jsonc +0 -4
- package/configs/testing-library.jsonc +0 -4
- package/configs/typescript.jsonc +0 -4
- package/configs/vitest.jsonc +0 -4
- package/jsoncLoader.d.mts +0 -10
- package/jsoncLoader.mjs +0 -27
- package/rules/styled-components.jsonc +0 -153
|
@@ -1,89 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
"categories": {},
|
|
5
|
-
"rules": {
|
|
1
|
+
export const importRules = {
|
|
2
|
+
plugins: ['import'],
|
|
3
|
+
rules: {
|
|
6
4
|
// Ensure named imports coupled with named exports
|
|
7
5
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/named.md
|
|
8
6
|
// note: oxlint import plugin uses "default" and "namespace" for resolution checks
|
|
9
|
-
|
|
7
|
+
'import/default': 'error',
|
|
10
8
|
|
|
11
9
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/namespace.md
|
|
12
|
-
|
|
10
|
+
'import/namespace': 'error',
|
|
13
11
|
|
|
14
12
|
// Forbid cyclical dependencies between modules
|
|
15
13
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-cycle.md
|
|
16
|
-
|
|
14
|
+
'import/no-cycle': ['error', { maxDepth: 2 }],
|
|
17
15
|
|
|
18
16
|
// Disallow duplicate imports
|
|
19
17
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-duplicates.md
|
|
20
|
-
|
|
18
|
+
'import/no-duplicates': 'error',
|
|
21
19
|
|
|
22
20
|
// Forbid default exports
|
|
23
21
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-default-export.md
|
|
24
|
-
|
|
22
|
+
'import/no-default-export': 'error',
|
|
25
23
|
|
|
26
24
|
// Forbid a module from importing itself
|
|
27
25
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-self-import.md
|
|
28
|
-
|
|
26
|
+
'import/no-self-import': 'error',
|
|
29
27
|
|
|
30
28
|
// Forbid import of modules using absolute paths
|
|
31
29
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-absolute-path.md
|
|
32
|
-
|
|
30
|
+
'import/no-absolute-path': 'error',
|
|
33
31
|
|
|
34
32
|
// Forbid empty named import blocks
|
|
35
33
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-empty-named-blocks.md
|
|
36
|
-
|
|
34
|
+
'import/no-empty-named-blocks': 'error',
|
|
37
35
|
|
|
38
36
|
// Do not allow a default import name to match a named export
|
|
39
37
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default.md
|
|
40
|
-
|
|
38
|
+
'import/no-named-as-default': 'error',
|
|
41
39
|
|
|
42
40
|
// Warn on accessing default export property names that are also named exports
|
|
43
41
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-as-default-member.md
|
|
44
|
-
|
|
42
|
+
'import/no-named-as-default-member': 'error',
|
|
45
43
|
|
|
46
44
|
// Prevent importing the default as if it were named
|
|
47
45
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-named-default.md
|
|
48
|
-
|
|
46
|
+
'import/no-named-default': 'error',
|
|
49
47
|
|
|
50
48
|
// Forbid mutable exports
|
|
51
49
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-mutable-exports.md
|
|
52
|
-
|
|
50
|
+
'import/no-mutable-exports': 'error',
|
|
53
51
|
|
|
54
52
|
// Reports if a module's default export is unnamed
|
|
55
53
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-anonymous-default-export.md
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
'import/no-anonymous-default-export': [
|
|
55
|
+
'error',
|
|
58
56
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
57
|
+
allowArray: false,
|
|
58
|
+
allowArrowFunction: false,
|
|
59
|
+
allowAnonymousClass: false,
|
|
60
|
+
allowAnonymousFunction: false,
|
|
61
|
+
allowCallExpression: true,
|
|
62
|
+
allowLiteral: false,
|
|
63
|
+
allowObject: false,
|
|
66
64
|
},
|
|
67
65
|
],
|
|
68
66
|
|
|
69
67
|
// Disallow non-import statements appearing before import statements
|
|
70
68
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/first.md
|
|
71
|
-
|
|
69
|
+
'import/first': 'error',
|
|
72
70
|
|
|
73
71
|
// Disallow require()
|
|
74
72
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-commonjs.md
|
|
75
|
-
|
|
73
|
+
'import/no-commonjs': 'error',
|
|
76
74
|
|
|
77
75
|
// Disallow AMD require/define
|
|
78
76
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-amd.md
|
|
79
|
-
|
|
77
|
+
'import/no-amd': 'error',
|
|
80
78
|
|
|
81
79
|
// Forbid require() calls with expressions
|
|
82
80
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-dynamic-require.md
|
|
83
|
-
|
|
81
|
+
'import/no-dynamic-require': 'error',
|
|
84
82
|
|
|
85
83
|
// Forbid Webpack loader syntax in imports
|
|
86
84
|
// https://github.com/un-ts/eslint-plugin-import-x/blob/master/docs/rules/no-webpack-loader-syntax.md
|
|
87
|
-
|
|
85
|
+
'import/no-webpack-loader-syntax': 'error',
|
|
88
86
|
},
|
|
89
|
-
}
|
|
87
|
+
};
|
|
@@ -1,133 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"categories": {},
|
|
8
|
-
"rules": {
|
|
1
|
+
// Native oxlint node rules + eslint-plugin-n via jsPlugins for rules
|
|
2
|
+
// without native equivalents.
|
|
3
|
+
export const nodeRules = {
|
|
4
|
+
plugins: ['node'],
|
|
5
|
+
jsPlugins: [{ name: 'n', specifier: 'eslint-plugin-n' }],
|
|
6
|
+
rules: {
|
|
9
7
|
// -- Native oxlint node rules --
|
|
10
8
|
|
|
11
9
|
// Require error handling in callbacks
|
|
12
10
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/handle-callback-err.md
|
|
13
|
-
|
|
11
|
+
'node/handle-callback-err': 'error',
|
|
14
12
|
|
|
15
13
|
// Disallow the assignment to exports
|
|
16
14
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-exports-assign.md
|
|
17
|
-
|
|
15
|
+
'node/no-exports-assign': 'error',
|
|
18
16
|
|
|
19
17
|
// Disallow new operators with calls to require
|
|
20
18
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-new-require.md
|
|
21
|
-
|
|
19
|
+
'node/no-new-require': 'error',
|
|
22
20
|
|
|
23
21
|
// Disallow string concatenation with __dirname and __filename
|
|
24
22
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-path-concat.md
|
|
25
|
-
|
|
23
|
+
'node/no-path-concat': 'error',
|
|
26
24
|
|
|
27
25
|
// -- eslint-plugin-n rules via jsPlugins --
|
|
28
26
|
|
|
29
27
|
// Disallow deprecated APIs
|
|
30
28
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-deprecated-api.md
|
|
31
|
-
|
|
29
|
+
'n/no-deprecated-api': 'error',
|
|
32
30
|
|
|
33
31
|
// Disallow bin files that npm ignores
|
|
34
32
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unpublished-bin.md
|
|
35
|
-
|
|
33
|
+
'n/no-unpublished-bin': 'error',
|
|
36
34
|
|
|
37
35
|
// Disallow import declarations which import private modules
|
|
38
36
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unpublished-import.md
|
|
39
|
-
|
|
37
|
+
'n/no-unpublished-import': 'error',
|
|
40
38
|
|
|
41
39
|
// Disallow require() expressions which import private modules
|
|
42
40
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unpublished-require.md
|
|
43
|
-
|
|
41
|
+
'n/no-unpublished-require': 'error',
|
|
44
42
|
|
|
45
43
|
// Disallow unsupported ECMAScript built-ins on the specified version
|
|
46
44
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unsupported-features/es-builtins.md
|
|
47
|
-
|
|
45
|
+
'n/no-unsupported-features/es-builtins': 'error',
|
|
48
46
|
|
|
49
47
|
// Disallow unsupported ECMAScript syntax on the specified version
|
|
50
48
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unsupported-features/es-syntax.md
|
|
51
|
-
|
|
49
|
+
'n/no-unsupported-features/es-syntax': ['error', { ignores: ['modules'] }],
|
|
52
50
|
|
|
53
51
|
// Disallow unsupported Node.js built-in APIs on the specified version
|
|
54
52
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-unsupported-features/node-builtins.md
|
|
55
|
-
|
|
53
|
+
'n/no-unsupported-features/node-builtins': 'error',
|
|
56
54
|
|
|
57
55
|
// Make process.exit() expressions the same code path as throw
|
|
58
56
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/process-exit-as-throw.md
|
|
59
|
-
|
|
57
|
+
'n/process-exit-as-throw': 'error',
|
|
60
58
|
|
|
61
59
|
// Disallow top-level await
|
|
62
60
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-top-level-await.md
|
|
63
|
-
|
|
61
|
+
'n/no-top-level-await': ['error', { ignoreBin: true }],
|
|
64
62
|
|
|
65
63
|
// Require return statements after callbacks
|
|
66
64
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/callback-return.md
|
|
67
|
-
|
|
65
|
+
'n/callback-return': 'error',
|
|
68
66
|
|
|
69
67
|
// Enforce either module.exports or exports
|
|
70
68
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/exports-style.md
|
|
71
|
-
|
|
69
|
+
'n/exports-style': 'error',
|
|
72
70
|
|
|
73
71
|
// Require require() to be called in the top-level module scope
|
|
74
72
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/global-require.md
|
|
75
|
-
|
|
73
|
+
'n/global-require': 'error',
|
|
76
74
|
|
|
77
75
|
// Disallow require calls to be mixed with regular variable declarations
|
|
78
76
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-mixed-requires.md
|
|
79
|
-
|
|
77
|
+
'n/no-mixed-requires': 'error',
|
|
80
78
|
|
|
81
79
|
// Restrict usage of specified node imports
|
|
82
80
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-restricted-import.md
|
|
83
|
-
|
|
81
|
+
'n/no-restricted-import': 'error',
|
|
84
82
|
|
|
85
83
|
// Restrict usage of specified node requires
|
|
86
84
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/no-restricted-require.md
|
|
87
|
-
|
|
85
|
+
'n/no-restricted-require': 'error',
|
|
88
86
|
|
|
89
87
|
// Enforce the use of the global Buffer
|
|
90
88
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/buffer.md
|
|
91
|
-
|
|
89
|
+
'n/prefer-global/buffer': 'error',
|
|
92
90
|
|
|
93
91
|
// Enforce the use of the global console
|
|
94
92
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/console.md
|
|
95
|
-
|
|
93
|
+
'n/prefer-global/console': 'error',
|
|
96
94
|
|
|
97
95
|
// Enforce the use of the global process
|
|
98
96
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/process.md
|
|
99
|
-
|
|
97
|
+
'n/prefer-global/process': 'error',
|
|
100
98
|
|
|
101
99
|
// Enforce the use of the global TextDecoder
|
|
102
100
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/text-decoder.md
|
|
103
|
-
|
|
101
|
+
'n/prefer-global/text-decoder': 'error',
|
|
104
102
|
|
|
105
103
|
// Enforce the use of the global TextEncoder
|
|
106
104
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/text-encoder.md
|
|
107
|
-
|
|
105
|
+
'n/prefer-global/text-encoder': 'error',
|
|
108
106
|
|
|
109
107
|
// Enforce the use of the global URLSearchParams
|
|
110
108
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/url-search-params.md
|
|
111
|
-
|
|
109
|
+
'n/prefer-global/url-search-params': 'error',
|
|
112
110
|
|
|
113
111
|
// Enforce the use of the global URL
|
|
114
112
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/url.md
|
|
115
|
-
|
|
113
|
+
'n/prefer-global/url': 'error',
|
|
116
114
|
|
|
117
115
|
// Enforce using the promises API of dns
|
|
118
116
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-promises/dns.md
|
|
119
|
-
|
|
117
|
+
'n/prefer-promises/dns': 'error',
|
|
120
118
|
|
|
121
119
|
// Enforce using the promises API of fs
|
|
122
120
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-promises/fs.md
|
|
123
|
-
|
|
121
|
+
'n/prefer-promises/fs': 'error',
|
|
124
122
|
|
|
125
123
|
// Require correct usage of hashbang
|
|
126
124
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/hashbang.md
|
|
127
|
-
|
|
125
|
+
'n/hashbang': 'error',
|
|
128
126
|
|
|
129
127
|
// Enforce using the node: protocol when importing Node.js builtins
|
|
130
128
|
// https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-node-protocol.md
|
|
131
|
-
|
|
129
|
+
'n/prefer-node-protocol': 'error',
|
|
132
130
|
},
|
|
133
|
-
}
|
|
131
|
+
};
|
|
@@ -1,195 +1,193 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"categories": {},
|
|
6
|
-
"rules": {
|
|
1
|
+
// All playwright rules loaded via jsPlugins (no native oxlint support).
|
|
2
|
+
export const playwrightRules = {
|
|
3
|
+
jsPlugins: ['eslint-plugin-playwright'],
|
|
4
|
+
rules: {
|
|
7
5
|
// Disallow focused tests
|
|
8
6
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-focused-test.md
|
|
9
|
-
|
|
7
|
+
'eslint-plugin-playwright/no-focused-test': 'error',
|
|
10
8
|
|
|
11
9
|
// Enforce having expectation in test body
|
|
12
10
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/expect-expect.md
|
|
13
|
-
|
|
11
|
+
'eslint-plugin-playwright/expect-expect': 'error',
|
|
14
12
|
|
|
15
13
|
// Enforce awaiting Playwright-specific methods
|
|
16
14
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/missing-playwright-await.md
|
|
17
|
-
|
|
15
|
+
'eslint-plugin-playwright/missing-playwright-await': 'error',
|
|
18
16
|
|
|
19
17
|
// Enforce maximum depth of nested describe blocks
|
|
20
18
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/max-nested-describe.md
|
|
21
|
-
|
|
19
|
+
'eslint-plugin-playwright/max-nested-describe': 'error',
|
|
22
20
|
|
|
23
21
|
// Disallow conditional expects
|
|
24
22
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-conditional-expect.md
|
|
25
|
-
|
|
23
|
+
'eslint-plugin-playwright/no-conditional-expect': 'error',
|
|
26
24
|
|
|
27
25
|
// Disallow conditional tests
|
|
28
26
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-conditional-in-test.md
|
|
29
|
-
|
|
27
|
+
'eslint-plugin-playwright/no-conditional-in-test': 'error',
|
|
30
28
|
|
|
31
29
|
// Disallow commented out tests
|
|
32
30
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-commented-out-tests.md
|
|
33
|
-
|
|
31
|
+
'eslint-plugin-playwright/no-commented-out-tests': 'error',
|
|
34
32
|
|
|
35
33
|
// Disallow duplicate hooks
|
|
36
34
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-duplicate-hooks.md
|
|
37
|
-
|
|
35
|
+
'eslint-plugin-playwright/no-duplicate-hooks': 'error',
|
|
38
36
|
|
|
39
37
|
// Disallow usage of ElementHandle
|
|
40
38
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-element-handle.md
|
|
41
|
-
|
|
39
|
+
'eslint-plugin-playwright/no-element-handle': 'error',
|
|
42
40
|
|
|
43
41
|
// Disallow usage of page.$eval and page.$$eval
|
|
44
42
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-eval.md
|
|
45
|
-
|
|
43
|
+
'eslint-plugin-playwright/no-eval': 'error',
|
|
46
44
|
|
|
47
45
|
// Disallow force option usage
|
|
48
46
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-force-option.md
|
|
49
|
-
|
|
47
|
+
'eslint-plugin-playwright/no-force-option': 'error',
|
|
50
48
|
|
|
51
49
|
// Disallow getByTitle locator
|
|
52
50
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-get-by-title.md
|
|
53
|
-
|
|
51
|
+
'eslint-plugin-playwright/no-get-by-title': 'error',
|
|
54
52
|
|
|
55
53
|
// Disallow nested steps
|
|
56
54
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-nested-step.md
|
|
57
|
-
|
|
55
|
+
'eslint-plugin-playwright/no-nested-step': 'error',
|
|
58
56
|
|
|
59
57
|
// Disallow networkidle option
|
|
60
58
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-networkidle.md
|
|
61
|
-
|
|
59
|
+
'eslint-plugin-playwright/no-networkidle': 'error',
|
|
62
60
|
|
|
63
61
|
// Disallow page.pause()
|
|
64
62
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-page-pause.md
|
|
65
|
-
|
|
63
|
+
'eslint-plugin-playwright/no-page-pause': 'error',
|
|
66
64
|
|
|
67
65
|
// Disallow raw locators
|
|
68
66
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-raw-locators.md
|
|
69
|
-
|
|
67
|
+
'eslint-plugin-playwright/no-raw-locators': 'error',
|
|
70
68
|
|
|
71
69
|
// Disallow standalone expects
|
|
72
70
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-standalone-expect.md
|
|
73
|
-
|
|
71
|
+
'eslint-plugin-playwright/no-standalone-expect': 'error',
|
|
74
72
|
|
|
75
73
|
// Disallow unsafe references in event handlers
|
|
76
74
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-unsafe-references.md
|
|
77
|
-
|
|
75
|
+
'eslint-plugin-playwright/no-unsafe-references': 'error',
|
|
78
76
|
|
|
79
77
|
// Disallow unused locators
|
|
80
78
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-unused-locators.md
|
|
81
|
-
|
|
79
|
+
'eslint-plugin-playwright/no-unused-locators': 'error',
|
|
82
80
|
|
|
83
81
|
// Disallow useless awaits
|
|
84
82
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-useless-await.md
|
|
85
|
-
|
|
83
|
+
'eslint-plugin-playwright/no-useless-await': 'error',
|
|
86
84
|
|
|
87
85
|
// Disallow useless not assertions
|
|
88
86
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-useless-not.md
|
|
89
|
-
|
|
87
|
+
'eslint-plugin-playwright/no-useless-not': 'error',
|
|
90
88
|
|
|
91
89
|
// Disallow waitForNavigation
|
|
92
90
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-wait-for-navigation.md
|
|
93
|
-
|
|
91
|
+
'eslint-plugin-playwright/no-wait-for-navigation': 'error',
|
|
94
92
|
|
|
95
93
|
// Disallow waitForSelector
|
|
96
94
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-wait-for-selector.md
|
|
97
|
-
|
|
95
|
+
'eslint-plugin-playwright/no-wait-for-selector': 'error',
|
|
98
96
|
|
|
99
97
|
// Disallow waitForTimeout
|
|
100
98
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-wait-for-timeout.md
|
|
101
|
-
|
|
99
|
+
'eslint-plugin-playwright/no-wait-for-timeout': 'error',
|
|
102
100
|
|
|
103
101
|
// Prefer native locators
|
|
104
102
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-native-locators.md
|
|
105
|
-
|
|
103
|
+
'eslint-plugin-playwright/prefer-native-locators': 'error',
|
|
106
104
|
|
|
107
105
|
// Prefer web-first assertions
|
|
108
106
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-web-first-assertions.md
|
|
109
|
-
|
|
107
|
+
'eslint-plugin-playwright/prefer-web-first-assertions': 'error',
|
|
110
108
|
|
|
111
109
|
// Require setup and teardown to be within a hook
|
|
112
110
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/require-hook.md
|
|
113
|
-
|
|
111
|
+
'eslint-plugin-playwright/require-hook': 'error',
|
|
114
112
|
|
|
115
113
|
// Enforce valid describe callback
|
|
116
114
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-describe-callback.md
|
|
117
|
-
|
|
115
|
+
'eslint-plugin-playwright/valid-describe-callback': 'error',
|
|
118
116
|
|
|
119
117
|
// Enforce valid expect usage
|
|
120
118
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-expect.md
|
|
121
|
-
|
|
119
|
+
'eslint-plugin-playwright/valid-expect': 'error',
|
|
122
120
|
|
|
123
121
|
// Enforce valid titles
|
|
124
122
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-title.md
|
|
125
|
-
|
|
123
|
+
'eslint-plugin-playwright/valid-title': 'error',
|
|
126
124
|
|
|
127
125
|
// Enforce maximum expect calls
|
|
128
126
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/max-expects.md
|
|
129
|
-
|
|
127
|
+
'eslint-plugin-playwright/max-expects': 'error',
|
|
130
128
|
|
|
131
129
|
// Enforce valid expect in promise
|
|
132
130
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-expect-in-promise.md
|
|
133
|
-
|
|
131
|
+
'eslint-plugin-playwright/valid-expect-in-promise': 'error',
|
|
134
132
|
|
|
135
133
|
// Enforce all tests in a top-level describe
|
|
136
134
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/require-top-level-describe.md
|
|
137
|
-
|
|
135
|
+
'eslint-plugin-playwright/require-top-level-describe': 'error',
|
|
138
136
|
|
|
139
137
|
// Enforce valid test tags
|
|
140
138
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/valid-test-tags.md
|
|
141
|
-
|
|
139
|
+
'eslint-plugin-playwright/valid-test-tags': 'error',
|
|
142
140
|
|
|
143
141
|
// Disallow slowed tests
|
|
144
142
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-slowed-test.md
|
|
145
|
-
|
|
143
|
+
'eslint-plugin-playwright/no-slowed-test': 'error',
|
|
146
144
|
|
|
147
145
|
// Disallow nth methods
|
|
148
146
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/no-nth-methods.md
|
|
149
|
-
|
|
147
|
+
'eslint-plugin-playwright/no-nth-methods': 'error',
|
|
150
148
|
|
|
151
149
|
// Prefer comparison matcher
|
|
152
150
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-comparison-matcher.md
|
|
153
|
-
|
|
151
|
+
'eslint-plugin-playwright/prefer-comparison-matcher': 'error',
|
|
154
152
|
|
|
155
153
|
// Prefer equality matcher
|
|
156
154
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-equality-matcher.md
|
|
157
|
-
|
|
155
|
+
'eslint-plugin-playwright/prefer-equality-matcher': 'error',
|
|
158
156
|
|
|
159
157
|
// Prefer hooks in order
|
|
160
158
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
161
|
-
|
|
159
|
+
'eslint-plugin-playwright/prefer-hooks-in-order': 'error',
|
|
162
160
|
|
|
163
161
|
// Prefer hooks on top
|
|
164
162
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-hooks-on-top.md
|
|
165
|
-
|
|
163
|
+
'eslint-plugin-playwright/prefer-hooks-on-top': 'error',
|
|
166
164
|
|
|
167
165
|
// Prefer locator
|
|
168
166
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-locator.md
|
|
169
|
-
|
|
167
|
+
'eslint-plugin-playwright/prefer-locator': 'error',
|
|
170
168
|
|
|
171
169
|
// Prefer strict equal
|
|
172
170
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-strict-equal.md
|
|
173
|
-
|
|
171
|
+
'eslint-plugin-playwright/prefer-strict-equal': 'error',
|
|
174
172
|
|
|
175
173
|
// Prefer toBe
|
|
176
174
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-to-be.md
|
|
177
|
-
|
|
175
|
+
'eslint-plugin-playwright/prefer-to-be': 'error',
|
|
178
176
|
|
|
179
177
|
// Prefer toContain
|
|
180
178
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-to-contain.md
|
|
181
|
-
|
|
179
|
+
'eslint-plugin-playwright/prefer-to-contain': 'error',
|
|
182
180
|
|
|
183
181
|
// Prefer toHaveCount
|
|
184
182
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-to-have-count.md
|
|
185
|
-
|
|
183
|
+
'eslint-plugin-playwright/prefer-to-have-count': 'error',
|
|
186
184
|
|
|
187
185
|
// Prefer toHaveLength
|
|
188
186
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/prefer-to-have-length.md
|
|
189
|
-
|
|
187
|
+
'eslint-plugin-playwright/prefer-to-have-length': 'error',
|
|
190
188
|
|
|
191
189
|
// Require toThrow message
|
|
192
190
|
// https://github.com/playwright-community/eslint-plugin-playwright/blob/main/docs/rules/require-to-throw-message.md
|
|
193
|
-
|
|
191
|
+
'eslint-plugin-playwright/require-to-throw-message': 'error',
|
|
194
192
|
},
|
|
195
|
-
}
|
|
193
|
+
};
|