@pplancq/eslint-config 2.2.0 → 2.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/rules/prettier.js CHANGED
@@ -1,3 +1,132 @@
1
1
  module.exports = {
2
- extends: ['plugin:prettier/recommended'],
2
+ plugins: ['prettier'],
3
+ rules: {
4
+ // eslint-plugin-prettier https://github.com/prettier/eslint-plugin-prettier
5
+ 'prettier/prettier': 'error',
6
+
7
+ // eslint
8
+ 'arrow-body-style': 'off',
9
+ curly: 'off',
10
+ 'no-unexpected-multiline': 'off',
11
+ 'prefer-arrow-callback': 'off',
12
+
13
+ // typescript-eslint/typescript-eslint https://github.com/typescript-eslint/typescript-eslint
14
+ '@typescript-eslint/block-spacing': 'off',
15
+ '@typescript-eslint/brace-style': 'off',
16
+ '@typescript-eslint/comma-dangle': 'off',
17
+ '@typescript-eslint/comma-spacing': 'off',
18
+ '@typescript-eslint/func-call-spacing': 'off',
19
+ '@typescript-eslint/indent': 'off',
20
+ '@typescript-eslint/key-spacing': 'off',
21
+ '@typescript-eslint/keyword-spacing': 'off',
22
+ '@typescript-eslint/lines-around-comment': 'off',
23
+ '@typescript-eslint/member-delimiter-style': 'off',
24
+ '@typescript-eslint/no-extra-parens': 'off',
25
+ '@typescript-eslint/no-extra-semi': 'off',
26
+ '@typescript-eslint/object-curly-spacing': 'off',
27
+ '@typescript-eslint/quotes': 'off',
28
+ '@typescript-eslint/semi': 'off',
29
+ '@typescript-eslint/space-before-blocks': 'off',
30
+ '@typescript-eslint/space-before-function-paren': 'off',
31
+ '@typescript-eslint/space-infix-ops': 'off',
32
+ '@typescript-eslint/type-annotation-spacing': 'off',
33
+
34
+ // eslint-plugin-react https://github.com/jsx-eslint/eslint-plugin-react
35
+ 'react/jsx-child-element-spacing': 'off',
36
+ 'react/jsx-closing-bracket-location': 'off',
37
+ 'react/jsx-closing-tag-location': 'off',
38
+ 'react/jsx-curly-newline': 'off',
39
+ 'react/jsx-curly-spacing': 'off',
40
+ 'react/jsx-equals-spacing': 'off',
41
+ 'react/jsx-first-prop-new-line': 'off',
42
+ 'react/jsx-indent': 'off',
43
+ 'react/jsx-indent-props': 'off',
44
+ 'react/jsx-max-props-per-line': 'off',
45
+ 'react/jsx-newline': 'off',
46
+ 'react/jsx-one-expression-per-line': 'off',
47
+ 'react/jsx-props-no-multi-spaces': 'off',
48
+ 'react/jsx-tag-spacing': 'off',
49
+ 'react/jsx-wrap-multilines': 'off',
50
+
51
+ // Deprecated eslint-plugin-react
52
+ // Deprecated since version 7.0.0.
53
+ // https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md#700---2017-05-06
54
+ 'react/jsx-space-before-closing': 'off',
55
+
56
+ // Deprecated eslint
57
+ // Deprecated since version 3.3.0.
58
+ // https://eslint.org/docs/rules/no-spaced-func
59
+ 'no-spaced-func': 'off',
60
+
61
+ // Deprecated since version 4.0.0.
62
+ // https://github.com/eslint/eslint/pull/8286
63
+ 'indent-legacy': 'off',
64
+
65
+ // Deprecated since version 8.53.0.
66
+ // https://eslint.org/blog/2023/10/deprecating-formatting-rules/
67
+ 'array-bracket-newline': 'off',
68
+ 'array-bracket-spacing': 'off',
69
+ 'array-element-newline': 'off',
70
+ 'arrow-parens': 'off',
71
+ 'arrow-spacing': 'off',
72
+ 'block-spacing': 'off',
73
+ 'brace-style': 'off',
74
+ 'comma-dangle': 'off',
75
+ 'comma-spacing': 'off',
76
+ 'comma-style': 'off',
77
+ 'computed-property-spacing': 'off',
78
+ 'dot-location': 'off',
79
+ 'eol-last': 'off',
80
+ 'func-call-spacing': 'off',
81
+ 'function-call-argument-newline': 'off',
82
+ 'function-paren-newline': 'off',
83
+ 'generator-star-spacing': 'off',
84
+ 'implicit-arrow-linebreak': 'off',
85
+ indent: 'off',
86
+ 'jsx-quotes': 'off',
87
+ 'key-spacing': 'off',
88
+ 'keyword-spacing': 'off',
89
+ 'linebreak-style': 'off',
90
+ 'lines-around-comment': 'off',
91
+ 'max-len': 'off',
92
+ 'max-statements-per-line': 'off',
93
+ 'multiline-ternary': 'off',
94
+ 'new-parens': 'off',
95
+ 'newline-per-chained-call': 'off',
96
+ 'no-confusing-arrow': 'off',
97
+ 'no-extra-parens': 'off',
98
+ 'no-extra-semi': 'off',
99
+ 'no-floating-decimal': 'off',
100
+ 'no-mixed-operators': 'off',
101
+ 'no-mixed-spaces-and-tabs': 'off',
102
+ 'no-multi-spaces': 'off',
103
+ 'no-multiple-empty-lines': 'off',
104
+ 'no-tabs': 'off',
105
+ 'no-trailing-spaces': 'off',
106
+ 'no-whitespace-before-property': 'off',
107
+ 'nonblock-statement-body-position': 'off',
108
+ 'object-curly-newline': 'off',
109
+ 'object-curly-spacing': 'off',
110
+ 'object-property-newline': 'off',
111
+ 'one-var-declaration-per-line': 'off',
112
+ 'operator-linebreak': 'off',
113
+ 'padded-blocks': 'off',
114
+ 'quote-props': 'off',
115
+ quotes: 'off',
116
+ 'rest-spread-spacing': 'off',
117
+ semi: 'off',
118
+ 'semi-spacing': 'off',
119
+ 'semi-style': 'off',
120
+ 'space-before-blocks': 'off',
121
+ 'space-before-function-paren': 'off',
122
+ 'space-in-parens': 'off',
123
+ 'space-infix-ops': 'off',
124
+ 'space-unary-ops': 'off',
125
+ 'switch-colon-spacing': 'off',
126
+ 'template-curly-spacing': 'off',
127
+ 'template-tag-spacing': 'off',
128
+ 'wrap-iife': 'off',
129
+ 'wrap-regex': 'off',
130
+ 'yield-star-spacing': 'off',
131
+ },
3
132
  };
@@ -0,0 +1,216 @@
1
+ module.exports = {
2
+ plugins: ['jsx-a11y'],
3
+ rules: {
4
+ // eslint-plugin-jsx-a11y https://github.com/jsx-eslint/eslint-plugin-jsx-a11y?tab=readme-ov-file
5
+
6
+ // Enforce emojis are wrapped in <span> and provide screenreader access.
7
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/accessible-emoji.md
8
+ // This rule is deprecated.
9
+ 'jsx-a11y/accessible-emoji': 'off',
10
+
11
+ // Enforce all elements that require alternative text have meaningful information to relay back to end user.
12
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/alt-text.md
13
+ 'jsx-a11y/alt-text': [
14
+ 'error',
15
+ {
16
+ elements: ['img', 'object', 'area', 'input[type="image"]'],
17
+ img: [],
18
+ object: [],
19
+ area: [],
20
+ 'input[type="image"]': [],
21
+ },
22
+ ],
23
+
24
+ // Enforce <a> text to not exactly match "click here", "here", "link", or "a link".
25
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-ambiguous-text.md
26
+ 'jsx-a11y/anchor-ambiguous-text': 'off',
27
+
28
+ // Enforce all anchors to contain accessible content.
29
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-has-content.md
30
+ 'jsx-a11y/anchor-has-content': ['error', { components: [] }],
31
+
32
+ // Enforce all anchors are valid, navigable elements.
33
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-is-valid.md
34
+ 'jsx-a11y/anchor-is-valid': [
35
+ 'error',
36
+ { components: ['Link'], specialLink: ['to'], aspects: ['noHref', 'invalidHref', 'preferButton'] },
37
+ ],
38
+
39
+ // Enforce elements with aria-activedescendant are tabbable.
40
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-activedescendant-has-tabindex.md
41
+ 'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
42
+
43
+ // Enforce all aria-* props are valid.
44
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-props.md
45
+ 'jsx-a11y/aria-props': 'error',
46
+
47
+ // Enforce ARIA state and property values are valid.
48
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-proptypes.md
49
+ 'jsx-a11y/aria-proptypes': 'error',
50
+
51
+ // Enforce that elements with ARIA roles must use a valid, non-abstract ARIA role.
52
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-role.md
53
+ 'jsx-a11y/aria-role': ['error', { ignoreNonDOM: false }],
54
+
55
+ // Enforce that elements that do not support ARIA roles, states, and properties do not have those attributes.
56
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/aria-unsupported-elements.md
57
+ 'jsx-a11y/aria-unsupported-elements': 'error',
58
+
59
+ // Enforce that autocomplete attributes are used correctly.
60
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/autocomplete-valid.md
61
+ 'jsx-a11y/autocomplete-valid': ['off', { inputComponents: [] }],
62
+
63
+ // Enforce a clickable non-interactive element has at least one keyboard event listener.
64
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/click-events-have-key-events.md
65
+ 'jsx-a11y/click-events-have-key-events': 'error',
66
+
67
+ // Enforce that a control (an interactive element) has a text label.
68
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/control-has-associated-label.md
69
+ 'jsx-a11y/control-has-associated-label': [
70
+ 'error',
71
+ {
72
+ labelAttributes: ['label'],
73
+ controlComponents: [],
74
+ ignoreElements: ['audio', 'canvas', 'embed', 'input', 'textarea', 'tr', 'video'],
75
+ ignoreRoles: [
76
+ 'grid',
77
+ 'listbox',
78
+ 'menu',
79
+ 'menubar',
80
+ 'radiogroup',
81
+ 'row',
82
+ 'tablist',
83
+ 'toolbar',
84
+ 'tree',
85
+ 'treegrid',
86
+ ],
87
+ depth: 5,
88
+ },
89
+ ],
90
+
91
+ // Enforce heading (h1, h2, etc) elements contain accessible content.
92
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/heading-has-content.md
93
+ 'jsx-a11y/heading-has-content': ['error', { components: [''] }],
94
+
95
+ // Enforce <html> element has lang prop.
96
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/html-has-lang.md
97
+ 'jsx-a11y/html-has-lang': 'error',
98
+
99
+ // Enforce iframe elements have a title attribute.
100
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/iframe-has-title.md
101
+ 'jsx-a11y/iframe-has-title': 'error',
102
+
103
+ // Enforce <img> alt prop does not contain the word "image", "picture", or "photo".
104
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/img-redundant-alt.md
105
+ 'jsx-a11y/img-redundant-alt': 'error',
106
+
107
+ // Enforce that elements with interactive handlers like onClick must be focusable.
108
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/interactive-supports-focus.md
109
+ 'jsx-a11y/interactive-supports-focus': 'error',
110
+
111
+ // Enforce that a label tag has a text label and an associated control.
112
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-associated-control.md
113
+ 'jsx-a11y/label-has-associated-control': [
114
+ 'error',
115
+ { labelComponents: [], labelAttributes: [], controlComponents: [], assert: 'both', depth: 25 },
116
+ ],
117
+
118
+ // Enforce that <label> elements have the htmlFor prop.
119
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/label-has-for.md
120
+ // This rule is deprecated. It was replaced by jsx-a11y/label-has-associated-control.
121
+ 'jsx-a11y/label-has-for': ['off', { components: [], required: { every: ['nesting', 'id'] }, allowChildren: false }],
122
+
123
+ // Enforce lang attribute has a valid value.
124
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/lang.md
125
+ 'jsx-a11y/lang': 'error',
126
+
127
+ // Enforces that <audio> and <video> elements must have a <track> for captions.
128
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/media-has-caption.md
129
+ 'jsx-a11y/media-has-caption': ['error', { audio: [], video: [], track: [] }],
130
+
131
+ // Enforce that onMouseOver/onMouseOut are accompanied by onFocus/onBlur for keyboard-only users.
132
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/mouse-events-have-key-events.md
133
+ 'jsx-a11y/mouse-events-have-key-events': 'error',
134
+
135
+ // Enforce that the accessKey prop is not used on any element to avoid complications with keyboard commands used by a screenreader.
136
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-access-key.md
137
+ 'jsx-a11y/no-access-key': 'error',
138
+
139
+ // Disallow aria-hidden="true" from being set on focusable elements.
140
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md
141
+ 'jsx-a11y/no-aria-hidden-on-focusable': 'off',
142
+
143
+ // Enforce autoFocus prop is not used.
144
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-autofocus.md
145
+ 'jsx-a11y/no-autofocus': ['error', { ignoreNonDOM: true }],
146
+
147
+ // Enforce distracting elements are not used.
148
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-distracting-elements.md
149
+ 'jsx-a11y/no-distracting-elements': ['error', { elements: ['marquee', 'blink'] }],
150
+
151
+ // Interactive elements should not be assigned non-interactive roles.
152
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-interactive-element-to-noninteractive-role.md
153
+ 'jsx-a11y/no-interactive-element-to-noninteractive-role': ['error', { tr: ['none', 'presentation'] }],
154
+
155
+ // Non-interactive elements should not be assigned mouse or keyboard event listeners.
156
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-interactions.md
157
+ 'jsx-a11y/no-noninteractive-element-interactions': [
158
+ 'error',
159
+ { handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'] },
160
+ ],
161
+
162
+ // Non-interactive elements should not be assigned interactive roles.
163
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-element-to-interactive-role.md
164
+ 'jsx-a11y/no-noninteractive-element-to-interactive-role': [
165
+ 'error',
166
+ {
167
+ ul: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
168
+ ol: ['listbox', 'menu', 'menubar', 'radiogroup', 'tablist', 'tree', 'treegrid'],
169
+ li: ['menuitem', 'option', 'row', 'tab', 'treeitem'],
170
+ table: ['grid'],
171
+ td: ['gridcell'],
172
+ },
173
+ ],
174
+
175
+ // tabIndex should only be declared on interactive elements.
176
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-noninteractive-tabindex.md
177
+ 'jsx-a11y/no-noninteractive-tabindex': ['error', { tags: [], roles: ['tabpanel'] }],
178
+
179
+ // Enforce usage of onBlur over onChange on select menus for accessibility.
180
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-onchange.md
181
+ // This rule is deprecated.
182
+ // Deprecated: This rule is based on reports of behavior of old browsers (eg. IE 10 and below). In the meantime, this behavior has been corrected, both in newer versions of browsers as well as in the DOM spec.
183
+ 'jsx-a11y/no-onchange': 'off',
184
+
185
+ // Enforce explicit role property is not the same as implicit/default role property on element.
186
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-redundant-roles.md
187
+ 'jsx-a11y/no-redundant-roles': 'error',
188
+
189
+ // Enforce that non-interactive, visible elements (such as <div>) that have click handlers use the role attribute.
190
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md
191
+ 'jsx-a11y/no-static-element-interactions': [
192
+ 'error',
193
+ { handlers: ['onClick', 'onMouseDown', 'onMouseUp', 'onKeyPress', 'onKeyDown', 'onKeyUp'] },
194
+ ],
195
+
196
+ // Enforces using semantic DOM elements over the ARIA role property.
197
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/prefer-tag-over-role.md
198
+ 'jsx-a11y/prefer-tag-over-role': 'off',
199
+
200
+ // Enforce that elements with ARIA roles must have all required attributes for that role.
201
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-has-required-aria-props.md
202
+ 'jsx-a11y/role-has-required-aria-props': 'error',
203
+
204
+ // Enforce that elements with explicit or implicit roles defined contain only aria-* properties supported by that role.
205
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/role-supports-aria-props.md
206
+ 'jsx-a11y/role-supports-aria-props': 'error',
207
+
208
+ // Enforce scope prop is only used on <th> elements.
209
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/scope.md
210
+ 'jsx-a11y/scope': 'error',
211
+
212
+ // Enforce tabIndex value is not greater than zero.
213
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/tabindex-no-positive.md
214
+ 'jsx-a11y/tabindex-no-positive': 'error',
215
+ },
216
+ };