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