@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,67 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"categories": {},
|
|
6
|
-
"rules": {
|
|
1
|
+
// All storybook rules loaded via jsPlugins (no native oxlint support).
|
|
2
|
+
export const storybookRules = {
|
|
3
|
+
jsPlugins: ['eslint-plugin-storybook'],
|
|
4
|
+
rules: {
|
|
7
5
|
// Interactions should be awaited
|
|
8
6
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/await-interactions.md
|
|
9
|
-
|
|
7
|
+
'eslint-plugin-storybook/await-interactions': 'error',
|
|
10
8
|
|
|
11
9
|
// Pass a context when invoking play function of another story
|
|
12
10
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/context-in-play-function.md
|
|
13
|
-
|
|
11
|
+
'eslint-plugin-storybook/context-in-play-function': 'error',
|
|
14
12
|
|
|
15
13
|
// The component property should be set
|
|
16
14
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/csf-component.md
|
|
17
|
-
|
|
15
|
+
'eslint-plugin-storybook/csf-component': 'error',
|
|
18
16
|
|
|
19
17
|
// Story files should have a default export
|
|
20
18
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/default-exports.md
|
|
21
|
-
|
|
19
|
+
'eslint-plugin-storybook/default-exports': 'error',
|
|
22
20
|
|
|
23
21
|
// Deprecated hierarchy separator in title property
|
|
24
22
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/hierarchy-separator.md
|
|
25
|
-
|
|
23
|
+
'eslint-plugin-storybook/hierarchy-separator': 'error',
|
|
26
24
|
|
|
27
25
|
// Meta should only have inline properties
|
|
28
26
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/meta-inline-properties.md
|
|
29
|
-
|
|
27
|
+
'eslint-plugin-storybook/meta-inline-properties': 'error',
|
|
30
28
|
|
|
31
29
|
// Meta should use satisfies operator for type safety
|
|
32
30
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/meta-satisfies-type.md
|
|
33
|
-
|
|
31
|
+
'eslint-plugin-storybook/meta-satisfies-type': 'error',
|
|
34
32
|
|
|
35
33
|
// A story should not have a redundant name property
|
|
36
34
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-redundant-story-name.md
|
|
37
|
-
|
|
35
|
+
'eslint-plugin-storybook/no-redundant-story-name': 'error',
|
|
38
36
|
|
|
39
37
|
// storiesOf is deprecated and should not be used
|
|
40
38
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-stories-of.md
|
|
41
|
-
|
|
39
|
+
'eslint-plugin-storybook/no-stories-of': 'error',
|
|
42
40
|
|
|
43
41
|
// Do not step out of the Storybook renderer package
|
|
44
42
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-renderer-packages.md
|
|
45
|
-
|
|
43
|
+
'eslint-plugin-storybook/no-renderer-packages': 'error',
|
|
46
44
|
|
|
47
45
|
// No uninstalled addons
|
|
48
46
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/no-uninstalled-addons.md
|
|
49
|
-
|
|
47
|
+
'eslint-plugin-storybook/no-uninstalled-addons': 'error',
|
|
50
48
|
|
|
51
49
|
// Stories should use PascalCase
|
|
52
50
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/prefer-pascal-case.md
|
|
53
|
-
|
|
51
|
+
'eslint-plugin-storybook/prefer-pascal-case': 'error',
|
|
54
52
|
|
|
55
53
|
// A story file must contain at least one story export
|
|
56
54
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/story-exports.md
|
|
57
|
-
|
|
55
|
+
'eslint-plugin-storybook/story-exports': 'error',
|
|
58
56
|
|
|
59
57
|
// Use @storybook/expect instead of plain expect
|
|
60
58
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/use-storybook-expect.md
|
|
61
|
-
|
|
59
|
+
'eslint-plugin-storybook/use-storybook-expect': 'error',
|
|
62
60
|
|
|
63
61
|
// Use @storybook/testing-library instead of plain testing-library
|
|
64
62
|
// https://github.com/storybookjs/eslint-plugin-storybook/blob/main/docs/rules/use-storybook-testing-library.md
|
|
65
|
-
|
|
63
|
+
'eslint-plugin-storybook/use-storybook-testing-library': 'error',
|
|
66
64
|
},
|
|
67
|
-
}
|
|
65
|
+
};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
// All styled-components-a11y rules loaded via jsPlugins (no native oxlint support).
|
|
2
|
+
export const styledComponentsRules = {
|
|
3
|
+
jsPlugins: ['eslint-plugin-styled-components-a11y'],
|
|
4
|
+
rules: {
|
|
5
|
+
// Enforce that all elements that require alternative text have meaningful information
|
|
6
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/alt-text.md
|
|
7
|
+
'eslint-plugin-styled-components-a11y/alt-text': 'error',
|
|
8
|
+
|
|
9
|
+
// Enforce that anchors have content
|
|
10
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/anchor-has-content.md
|
|
11
|
+
'eslint-plugin-styled-components-a11y/anchor-has-content': 'error',
|
|
12
|
+
|
|
13
|
+
// Enforce all anchors are valid, navigable elements
|
|
14
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/anchor-is-valid.md
|
|
15
|
+
'eslint-plugin-styled-components-a11y/anchor-is-valid': 'error',
|
|
16
|
+
|
|
17
|
+
// Enforce that elements with aria-activedescendant have tabindex
|
|
18
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/aria-activedescendant-has-tabindex.md
|
|
19
|
+
'eslint-plugin-styled-components-a11y/aria-activedescendant-has-tabindex': 'error',
|
|
20
|
+
|
|
21
|
+
// Enforce that elements have valid aria-* props
|
|
22
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/aria-props.md
|
|
23
|
+
'eslint-plugin-styled-components-a11y/aria-props': 'error',
|
|
24
|
+
|
|
25
|
+
// Enforce that ARIA state and property values are valid
|
|
26
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/aria-proptypes.md
|
|
27
|
+
'eslint-plugin-styled-components-a11y/aria-proptypes': 'error',
|
|
28
|
+
|
|
29
|
+
// Enforce that elements with ARIA roles have all required attributes for that role
|
|
30
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/aria-role.md
|
|
31
|
+
'eslint-plugin-styled-components-a11y/aria-role': 'error',
|
|
32
|
+
|
|
33
|
+
// Enforce that certain elements don't have ARIA roles, states, or properties
|
|
34
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/aria-unsupported-elements.md
|
|
35
|
+
'eslint-plugin-styled-components-a11y/aria-unsupported-elements': 'error',
|
|
36
|
+
|
|
37
|
+
// Enforce that autocomplete attribute is correct
|
|
38
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/autocomplete-valid.md
|
|
39
|
+
'eslint-plugin-styled-components-a11y/autocomplete-valid': 'error',
|
|
40
|
+
|
|
41
|
+
// Enforce click events have key events
|
|
42
|
+
// https://github.com/brendanmorrell/eslint-plugin-styled-components-a11y/blob/master/docs/rules/click-events-have-key-events.md
|
|
43
|
+
'eslint-plugin-styled-components-a11y/click-events-have-key-events': 'error',
|
|
44
|
+
|
|
45
|
+
// Enforce a label tag has a text label and an associated control
|
|
46
|
+
'eslint-plugin-styled-components-a11y/control-has-associated-label': [
|
|
47
|
+
'error',
|
|
48
|
+
{
|
|
49
|
+
ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
|
|
50
|
+
ignoreRoles: [
|
|
51
|
+
'grid',
|
|
52
|
+
'listbox',
|
|
53
|
+
'menu',
|
|
54
|
+
'menubar',
|
|
55
|
+
'radiogroup',
|
|
56
|
+
'row',
|
|
57
|
+
'tablist',
|
|
58
|
+
'toolbar',
|
|
59
|
+
'tree',
|
|
60
|
+
'treegrid',
|
|
61
|
+
],
|
|
62
|
+
includeRoles: ['alert', 'dialog'],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
|
|
66
|
+
// Enforce heading elements have content
|
|
67
|
+
'eslint-plugin-styled-components-a11y/heading-has-content': 'error',
|
|
68
|
+
|
|
69
|
+
// Enforce html element has lang prop
|
|
70
|
+
'eslint-plugin-styled-components-a11y/html-has-lang': 'error',
|
|
71
|
+
|
|
72
|
+
// Enforce iframe elements have a title attribute
|
|
73
|
+
'eslint-plugin-styled-components-a11y/iframe-has-title': 'error',
|
|
74
|
+
|
|
75
|
+
// Enforce img alt prop does not contain the word image, picture, or photo
|
|
76
|
+
'eslint-plugin-styled-components-a11y/img-redundant-alt': 'error',
|
|
77
|
+
|
|
78
|
+
// Enforce that interactive elements are focusable
|
|
79
|
+
'eslint-plugin-styled-components-a11y/interactive-supports-focus': [
|
|
80
|
+
'error',
|
|
81
|
+
{
|
|
82
|
+
tabbable: [
|
|
83
|
+
'button',
|
|
84
|
+
'checkbox',
|
|
85
|
+
'link',
|
|
86
|
+
'progressbar',
|
|
87
|
+
'searchbox',
|
|
88
|
+
'slider',
|
|
89
|
+
'spinbutton',
|
|
90
|
+
'switch',
|
|
91
|
+
'textbox',
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
|
|
96
|
+
// Enforce label-control association
|
|
97
|
+
'eslint-plugin-styled-components-a11y/label-has-associated-control': 'error',
|
|
98
|
+
|
|
99
|
+
// Enforce that media elements have captions
|
|
100
|
+
'eslint-plugin-styled-components-a11y/media-has-caption': 'error',
|
|
101
|
+
|
|
102
|
+
// Enforce onMouseOver/onMouseOut are accompanied by onFocus/onBlur
|
|
103
|
+
'eslint-plugin-styled-components-a11y/mouse-events-have-key-events': 'error',
|
|
104
|
+
|
|
105
|
+
// Enforce that the accessKey prop is not used
|
|
106
|
+
'eslint-plugin-styled-components-a11y/no-access-key': 'error',
|
|
107
|
+
|
|
108
|
+
// Enforce autoFocus prop is not used
|
|
109
|
+
'eslint-plugin-styled-components-a11y/no-autofocus': 'error',
|
|
110
|
+
|
|
111
|
+
// Enforce distracting elements are not used
|
|
112
|
+
'eslint-plugin-styled-components-a11y/no-distracting-elements': 'error',
|
|
113
|
+
|
|
114
|
+
// Enforce interactive elements not assigned non-interactive roles
|
|
115
|
+
'eslint-plugin-styled-components-a11y/no-interactive-element-to-noninteractive-role': 'error',
|
|
116
|
+
|
|
117
|
+
// Enforce non-interactive elements do not have interactions
|
|
118
|
+
'eslint-plugin-styled-components-a11y/no-noninteractive-element-interactions': [
|
|
119
|
+
'error',
|
|
120
|
+
{
|
|
121
|
+
body: ['onError', 'onLoad'],
|
|
122
|
+
iframe: ['onError', 'onLoad'],
|
|
123
|
+
img: ['onError', 'onLoad'],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
|
|
127
|
+
// Enforce non-interactive elements not assigned interactive roles
|
|
128
|
+
'eslint-plugin-styled-components-a11y/no-noninteractive-element-to-interactive-role': 'error',
|
|
129
|
+
|
|
130
|
+
// Enforce tabIndex value is not greater than zero
|
|
131
|
+
'eslint-plugin-styled-components-a11y/no-noninteractive-tabindex': 'error',
|
|
132
|
+
|
|
133
|
+
// Enforce explicit role is not redundant
|
|
134
|
+
'eslint-plugin-styled-components-a11y/no-redundant-roles': 'error',
|
|
135
|
+
|
|
136
|
+
// Enforce non-interactive visible elements with click handlers use the role attribute
|
|
137
|
+
'eslint-plugin-styled-components-a11y/no-static-element-interactions': 'error',
|
|
138
|
+
|
|
139
|
+
// Enforce that elements with ARIA roles have all required attributes
|
|
140
|
+
'eslint-plugin-styled-components-a11y/role-has-required-aria-props': 'error',
|
|
141
|
+
|
|
142
|
+
// Enforce that elements with roles support all aria-* properties for that role
|
|
143
|
+
'eslint-plugin-styled-components-a11y/role-supports-aria-props': 'error',
|
|
144
|
+
|
|
145
|
+
// Enforce scope prop is only used on th elements
|
|
146
|
+
'eslint-plugin-styled-components-a11y/scope': 'error',
|
|
147
|
+
|
|
148
|
+
// Enforce tabIndex value is not greater than zero
|
|
149
|
+
'eslint-plugin-styled-components-a11y/tabindex-no-positive': 'error',
|
|
150
|
+
},
|
|
151
|
+
};
|
|
@@ -1,173 +1,171 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"categories": {},
|
|
6
|
-
"rules": {
|
|
1
|
+
// All testing-library + jest-dom rules loaded via jsPlugins (no native oxlint support).
|
|
2
|
+
export const testingLibraryRules = {
|
|
3
|
+
jsPlugins: ['eslint-plugin-testing-library', 'eslint-plugin-jest-dom'],
|
|
4
|
+
rules: {
|
|
7
5
|
// -- testing-library rules --
|
|
8
6
|
|
|
9
7
|
// Enforce async events to be awaited
|
|
10
8
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-async-events.md
|
|
11
|
-
|
|
9
|
+
'eslint-plugin-testing-library/await-async-events': 'error',
|
|
12
10
|
|
|
13
11
|
// Enforce async queries to be awaited
|
|
14
12
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-async-queries.md
|
|
15
|
-
|
|
13
|
+
'eslint-plugin-testing-library/await-async-queries': 'error',
|
|
16
14
|
|
|
17
15
|
// Enforce async utils to be awaited
|
|
18
16
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/await-async-utils.md
|
|
19
|
-
|
|
17
|
+
'eslint-plugin-testing-library/await-async-utils': 'error',
|
|
20
18
|
|
|
21
19
|
// Enforce consistent data-testid usage
|
|
22
20
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/consistent-data-testid.md
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
21
|
+
'eslint-plugin-testing-library/consistent-data-testid': [
|
|
22
|
+
'error',
|
|
23
|
+
{ testIdPattern: '.*', testIdAttribute: ['data-testid'] },
|
|
26
24
|
],
|
|
27
25
|
|
|
28
26
|
// Disallow awaiting sync events
|
|
29
27
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-await-sync-events.md
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
28
|
+
'eslint-plugin-testing-library/no-await-sync-events': [
|
|
29
|
+
'error',
|
|
30
|
+
{ eventModules: ['fire-event'] },
|
|
33
31
|
],
|
|
34
32
|
|
|
35
33
|
// Disallow awaiting sync queries
|
|
36
34
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-await-sync-queries.md
|
|
37
|
-
|
|
35
|
+
'eslint-plugin-testing-library/no-await-sync-queries': 'error',
|
|
38
36
|
|
|
39
37
|
// Disallow the use of container methods
|
|
40
38
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-container.md
|
|
41
|
-
|
|
39
|
+
'eslint-plugin-testing-library/no-container': 'error',
|
|
42
40
|
|
|
43
41
|
// Disallow the use of debugging utilities
|
|
44
42
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-debugging-utils.md
|
|
45
|
-
|
|
43
|
+
'eslint-plugin-testing-library/no-debugging-utils': 'error',
|
|
46
44
|
|
|
47
45
|
// Disallow importing from DOM Testing Library
|
|
48
46
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-dom-import.md
|
|
49
|
-
|
|
47
|
+
'eslint-plugin-testing-library/no-dom-import': 'error',
|
|
50
48
|
|
|
51
49
|
// Disallow the use of the global RegExp flag in queries
|
|
52
50
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-global-regexp-flag-in-query.md
|
|
53
|
-
|
|
51
|
+
'eslint-plugin-testing-library/no-global-regexp-flag-in-query': 'error',
|
|
54
52
|
|
|
55
53
|
// Disallow the use of cleanup
|
|
56
54
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-manual-cleanup.md
|
|
57
|
-
|
|
55
|
+
'eslint-plugin-testing-library/no-manual-cleanup': 'error',
|
|
58
56
|
|
|
59
57
|
// Disallow direct Node access
|
|
60
58
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-node-access.md
|
|
61
|
-
|
|
59
|
+
'eslint-plugin-testing-library/no-node-access': 'error',
|
|
62
60
|
|
|
63
61
|
// Disallow the use of promises passed to a fireEvent method
|
|
64
62
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-promise-in-fire-event.md
|
|
65
|
-
|
|
63
|
+
'eslint-plugin-testing-library/no-promise-in-fire-event': 'error',
|
|
66
64
|
|
|
67
65
|
// Disallow the use of render in testing frameworks setup files
|
|
68
66
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-render-in-lifecycle.md
|
|
69
|
-
|
|
67
|
+
'eslint-plugin-testing-library/no-render-in-lifecycle': 'error',
|
|
70
68
|
|
|
71
69
|
// Disallow the use of data-testid queries
|
|
72
70
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-test-id-queries.md
|
|
73
|
-
|
|
71
|
+
'eslint-plugin-testing-library/no-test-id-queries': 'error',
|
|
74
72
|
|
|
75
73
|
// Disallow unnecessary act wrapping
|
|
76
74
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-unnecessary-act.md
|
|
77
|
-
|
|
75
|
+
'eslint-plugin-testing-library/no-unnecessary-act': 'error',
|
|
78
76
|
|
|
79
77
|
// Disallow the use of multiple expect inside waitFor
|
|
80
78
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-wait-for-multiple-assertions.md
|
|
81
|
-
|
|
79
|
+
'eslint-plugin-testing-library/no-wait-for-multiple-assertions': 'error',
|
|
82
80
|
|
|
83
81
|
// Disallow the use of side effects in waitFor
|
|
84
82
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-wait-for-side-effects.md
|
|
85
|
-
|
|
83
|
+
'eslint-plugin-testing-library/no-wait-for-side-effects': 'error',
|
|
86
84
|
|
|
87
85
|
// Disallow the use of snapshot inside waitFor
|
|
88
86
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/no-wait-for-snapshot.md
|
|
89
|
-
|
|
87
|
+
'eslint-plugin-testing-library/no-wait-for-snapshot': 'error',
|
|
90
88
|
|
|
91
89
|
// Suggest using explicit assertions rather than standalone queries
|
|
92
90
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-explicit-assert.md
|
|
93
|
-
|
|
91
|
+
'eslint-plugin-testing-library/prefer-explicit-assert': 'error',
|
|
94
92
|
|
|
95
93
|
// Suggest using find* queries instead of waitFor + get* queries
|
|
96
94
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-find-by.md
|
|
97
|
-
|
|
95
|
+
'eslint-plugin-testing-library/prefer-find-by': 'error',
|
|
98
96
|
|
|
99
97
|
// Ensure appropriate get*/query* queries are used with their respective matchers
|
|
100
98
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-presence-queries.md
|
|
101
|
-
|
|
99
|
+
'eslint-plugin-testing-library/prefer-presence-queries': 'error',
|
|
102
100
|
|
|
103
101
|
// Suggest using queryBy* queries when waiting for disappearance
|
|
104
102
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-query-by-disappearance.md
|
|
105
|
-
|
|
103
|
+
'eslint-plugin-testing-library/prefer-query-by-disappearance': 'error',
|
|
106
104
|
|
|
107
105
|
// Ensure the configured get*/query* query is used with the corresponding matchers
|
|
108
106
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-query-matchers.md
|
|
109
|
-
|
|
107
|
+
'eslint-plugin-testing-library/prefer-query-matchers': 'error',
|
|
110
108
|
|
|
111
109
|
// Suggest using screen while querying
|
|
112
110
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-screen-queries.md
|
|
113
|
-
|
|
111
|
+
'eslint-plugin-testing-library/prefer-screen-queries': 'error',
|
|
114
112
|
|
|
115
113
|
// Suggest using userEvent over fireEvent
|
|
116
114
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-user-event.md
|
|
117
|
-
|
|
115
|
+
'eslint-plugin-testing-library/prefer-user-event': 'error',
|
|
118
116
|
|
|
119
117
|
// Suggest using userEvent.setup
|
|
120
118
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/prefer-user-event-setup.md
|
|
121
|
-
|
|
119
|
+
'eslint-plugin-testing-library/prefer-user-event-setup': 'error',
|
|
122
120
|
|
|
123
121
|
// Enforce a valid naming for return value of render
|
|
124
122
|
// https://github.com/testing-library/eslint-plugin-testing-library/blob/main/docs/rules/render-result-naming-convention.md
|
|
125
|
-
|
|
123
|
+
'eslint-plugin-testing-library/render-result-naming-convention': 'error',
|
|
126
124
|
|
|
127
125
|
// -- jest-dom rules --
|
|
128
126
|
|
|
129
127
|
// Prefer toBeChecked over checking attributes
|
|
130
128
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-checked.md
|
|
131
|
-
|
|
129
|
+
'eslint-plugin-jest-dom/prefer-checked': 'error',
|
|
132
130
|
|
|
133
131
|
// Prefer toBeEmptyDOMElement over checking innerHTML
|
|
134
132
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-empty.md
|
|
135
|
-
|
|
133
|
+
'eslint-plugin-jest-dom/prefer-empty': 'error',
|
|
136
134
|
|
|
137
135
|
// Prefer toBeEnabled/toBeDisabled over checking attributes
|
|
138
136
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-enabled-disabled.md
|
|
139
|
-
|
|
137
|
+
'eslint-plugin-jest-dom/prefer-enabled-disabled': 'error',
|
|
140
138
|
|
|
141
139
|
// Prefer toHaveFocus over checking document.activeElement
|
|
142
140
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-focus.md
|
|
143
|
-
|
|
141
|
+
'eslint-plugin-jest-dom/prefer-focus': 'error',
|
|
144
142
|
|
|
145
143
|
// Prefer toBeInTheDocument over checking for null/truthy
|
|
146
144
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-in-document.md
|
|
147
|
-
|
|
145
|
+
'eslint-plugin-jest-dom/prefer-in-document': 'error',
|
|
148
146
|
|
|
149
147
|
// Prefer toBeRequired over checking attributes
|
|
150
148
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-required.md
|
|
151
|
-
|
|
149
|
+
'eslint-plugin-jest-dom/prefer-required': 'error',
|
|
152
150
|
|
|
153
151
|
// Prefer toHaveAttribute over checking getAttribute
|
|
154
152
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-attribute.md
|
|
155
|
-
|
|
153
|
+
'eslint-plugin-jest-dom/prefer-to-have-attribute': 'error',
|
|
156
154
|
|
|
157
155
|
// Prefer toHaveClass over checking className
|
|
158
156
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-class.md
|
|
159
|
-
|
|
157
|
+
'eslint-plugin-jest-dom/prefer-to-have-class': 'error',
|
|
160
158
|
|
|
161
159
|
// Prefer toHaveStyle over checking style attribute
|
|
162
160
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-style.md
|
|
163
|
-
|
|
161
|
+
'eslint-plugin-jest-dom/prefer-to-have-style': 'error',
|
|
164
162
|
|
|
165
163
|
// Prefer toHaveTextContent over checking textContent
|
|
166
164
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-text-content.md
|
|
167
|
-
|
|
165
|
+
'eslint-plugin-jest-dom/prefer-to-have-text-content': 'error',
|
|
168
166
|
|
|
169
167
|
// Prefer toHaveValue over checking value property
|
|
170
168
|
// https://github.com/testing-library/eslint-plugin-jest-dom/blob/main/docs/rules/prefer-to-have-value.md
|
|
171
|
-
|
|
169
|
+
'eslint-plugin-jest-dom/prefer-to-have-value': 'error',
|
|
172
170
|
},
|
|
173
|
-
}
|
|
171
|
+
};
|