eslint-plugin-web-components-doctor 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/LICENSE +191 -0
- package/README.md +309 -0
- package/dist/adapters/jsx-adapter.d.ts +20 -0
- package/dist/adapters/jsx-adapter.d.ts.map +1 -0
- package/dist/adapters/jsx-adapter.js +150 -0
- package/dist/adapters/jsx-adapter.js.map +1 -0
- package/dist/adapters/lit-adapter.d.ts +19 -0
- package/dist/adapters/lit-adapter.d.ts.map +1 -0
- package/dist/adapters/lit-adapter.js +145 -0
- package/dist/adapters/lit-adapter.js.map +1 -0
- package/dist/adapters/utils.d.ts +36 -0
- package/dist/adapters/utils.d.ts.map +1 -0
- package/dist/adapters/utils.js +58 -0
- package/dist/adapters/utils.js.map +1 -0
- package/dist/core/rule-factory.d.ts +44 -0
- package/dist/core/rule-factory.d.ts.map +1 -0
- package/dist/core/rule-factory.js +443 -0
- package/dist/core/rule-factory.js.map +1 -0
- package/dist/core/types.d.ts +103 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +13 -0
- package/dist/core/types.js.map +1 -0
- package/dist/descriptors/components.d.ts +21 -0
- package/dist/descriptors/components.d.ts.map +1 -0
- package/dist/descriptors/components.js +249 -0
- package/dist/descriptors/components.js.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +77 -0
- package/dist/index.js.map +1 -0
- package/dist/rules/accessible-component.d.ts +13 -0
- package/dist/rules/accessible-component.d.ts.map +1 -0
- package/dist/rules/accessible-component.js +15 -0
- package/dist/rules/accessible-component.js.map +1 -0
- package/dist/rules/no-deprecated.d.ts +13 -0
- package/dist/rules/no-deprecated.d.ts.map +1 -0
- package/dist/rules/no-deprecated.js +15 -0
- package/dist/rules/no-deprecated.js.map +1 -0
- package/dist/rules/required-attributes.d.ts +13 -0
- package/dist/rules/required-attributes.d.ts.map +1 -0
- package/dist/rules/required-attributes.js +15 -0
- package/dist/rules/required-attributes.js.map +1 -0
- package/dist/rules/valid-attribute-values.d.ts +13 -0
- package/dist/rules/valid-attribute-values.d.ts.map +1 -0
- package/dist/rules/valid-attribute-values.js +15 -0
- package/dist/rules/valid-attribute-values.js.map +1 -0
- package/dist/rules/valid-slot-children.d.ts +13 -0
- package/dist/rules/valid-slot-children.d.ts.map +1 -0
- package/dist/rules/valid-slot-children.js +15 -0
- package/dist/rules/valid-slot-children.js.map +1 -0
- package/dist/rules/valid-slot-names.d.ts +13 -0
- package/dist/rules/valid-slot-names.d.ts.map +1 -0
- package/dist/rules/valid-slot-names.js +15 -0
- package/dist/rules/valid-slot-names.js.map +1 -0
- package/package.json +64 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding any notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2026 Adobe. All rights reserved.
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
# eslint-plugin-web-components-doctor
|
|
2
|
+
|
|
3
|
+
ESLint plugin for [Spectrum Web Components](https://opensource.adobe.com/spectrum-web-components/) consumers. Catches accessibility gaps, deprecated APIs, and invalid attribute usage **at lint time** — shifting left what `window.__swc.warn()` and axe catch at runtime.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install eslint-plugin-web-components-doctor --save-dev
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start (ESLint 9+ flat config)
|
|
12
|
+
|
|
13
|
+
### Lit (html tagged templates)
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
// eslint.config.js
|
|
17
|
+
import swc from 'eslint-plugin-web-components-doctor';
|
|
18
|
+
|
|
19
|
+
export default [
|
|
20
|
+
swc.configs.recommended,
|
|
21
|
+
];
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### JSX / TSX (React, Preact, etc.)
|
|
25
|
+
|
|
26
|
+
The plugin automatically detects both syntaxes. Just enable JSX parsing in your ESLint config:
|
|
27
|
+
|
|
28
|
+
```js
|
|
29
|
+
// eslint.config.js
|
|
30
|
+
import swc from 'eslint-plugin-web-components-doctor';
|
|
31
|
+
|
|
32
|
+
export default [
|
|
33
|
+
{
|
|
34
|
+
...swc.configs.recommended,
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
ecmaFeatures: { jsx: true },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
];
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Both kebab-case custom elements and PascalCase React wrappers are supported:
|
|
45
|
+
|
|
46
|
+
```jsx
|
|
47
|
+
// These are equivalent — both are checked
|
|
48
|
+
<sp-action-menu label="Actions"></sp-action-menu>
|
|
49
|
+
<SpActionMenu label="Actions"></SpActionMenu>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Or for strict CI enforcement:
|
|
53
|
+
|
|
54
|
+
```js
|
|
55
|
+
export default [
|
|
56
|
+
swc.configs.strict,
|
|
57
|
+
];
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Rules
|
|
61
|
+
|
|
62
|
+
### `swc/accessible-component`
|
|
63
|
+
|
|
64
|
+
Require accessibility attributes on SWC elements.
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
// ❌ Bad — Lit
|
|
68
|
+
html`<sp-action-menu></sp-action-menu>`;
|
|
69
|
+
html`<sp-picker></sp-picker>`;
|
|
70
|
+
|
|
71
|
+
// ❌ Bad — JSX
|
|
72
|
+
<SpActionMenu></SpActionMenu>
|
|
73
|
+
<SpPicker></SpPicker>
|
|
74
|
+
|
|
75
|
+
// ✅ Good — Lit
|
|
76
|
+
html`<sp-action-menu label="More actions"></sp-action-menu>`;
|
|
77
|
+
html`<sp-picker aria-label="Select option"></sp-picker>`;
|
|
78
|
+
|
|
79
|
+
// ✅ Good — JSX
|
|
80
|
+
<SpActionMenu label="More actions"></SpActionMenu>
|
|
81
|
+
<SpPicker aria-label="Select option"></SpPicker>
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
| Element | Required (at least one of) |
|
|
85
|
+
|---|---|
|
|
86
|
+
| `<sp-action-menu>` | `label`, `aria-label`, `aria-labelledby` |
|
|
87
|
+
| `<sp-avatar>` | `label`, `is-decorative` |
|
|
88
|
+
| `<sp-clear-button>` | `label` |
|
|
89
|
+
| `<sp-dialog-wrapper>` | `headline` |
|
|
90
|
+
| `<sp-picker>` | `label`, `aria-label`, `aria-labelledby` |
|
|
91
|
+
| `<sp-progress-bar>` | `label`, `aria-label`, `aria-labelledby` |
|
|
92
|
+
| `<sp-progress-circle>` | `label`, `aria-label`, `aria-labelledby` |
|
|
93
|
+
| `<sp-status-light>` | `label`, `aria-label`, `aria-labelledby` |
|
|
94
|
+
| `<sp-tabs>` | `accessible-label`, `aria-label`, `aria-labelledby` |
|
|
95
|
+
|
|
96
|
+
### `swc/no-deprecated`
|
|
97
|
+
|
|
98
|
+
Flag deprecated attributes and attribute values.
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
// ❌ Bad — Lit
|
|
102
|
+
html`<sp-button variant="cta">Click</sp-button>`;
|
|
103
|
+
html`<sp-overlay allow-outside-click></sp-overlay>`;
|
|
104
|
+
|
|
105
|
+
// ❌ Bad — JSX
|
|
106
|
+
<SpButton variant="cta">Click</SpButton>
|
|
107
|
+
<SpOverlay allowOutsideClick></SpOverlay>
|
|
108
|
+
|
|
109
|
+
// ✅ Good — Lit
|
|
110
|
+
html`<sp-button variant="accent">Click</sp-button>`;
|
|
111
|
+
html`<sp-overlay></sp-overlay>`;
|
|
112
|
+
|
|
113
|
+
// ✅ Good — JSX
|
|
114
|
+
<SpButton variant="accent">Click</SpButton>
|
|
115
|
+
<SpOverlay></SpOverlay>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
| Deprecated | Replacement |
|
|
119
|
+
|---|---|
|
|
120
|
+
| `<sp-button variant="cta">` | `variant="accent"` |
|
|
121
|
+
| `<sp-button variant="overBackground">` | `static-color="white" treatment="outline"` |
|
|
122
|
+
| `<sp-button href="...">` | Use native `<a>` element |
|
|
123
|
+
| `<sp-overlay allow-outside-click>` | Remove attribute |
|
|
124
|
+
| `<sp-status-light variant="accent">` | `"neutral"` or `"info"` |
|
|
125
|
+
| `<sp-status-light disabled>` | Remove attribute |
|
|
126
|
+
|
|
127
|
+
### `swc/required-attributes`
|
|
128
|
+
|
|
129
|
+
Enforce presence of configuration attributes.
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
// ❌ Bad
|
|
133
|
+
html`<sp-theme></sp-theme>`;
|
|
134
|
+
html`<overlay-trigger>content</overlay-trigger>`;
|
|
135
|
+
|
|
136
|
+
// ✅ Good
|
|
137
|
+
html`<sp-theme color="light" scale="medium" system="spectrum"></sp-theme>`;
|
|
138
|
+
html`<overlay-trigger triggered-by="click hover">content</overlay-trigger>`;
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `swc/valid-attribute-values`
|
|
142
|
+
|
|
143
|
+
Catch invalid enum values at lint time.
|
|
144
|
+
|
|
145
|
+
```js
|
|
146
|
+
// ❌ Bad
|
|
147
|
+
html`<sp-theme color="lightest"></sp-theme>`;
|
|
148
|
+
html`<sp-button variant="danger">Click</sp-button>`;
|
|
149
|
+
|
|
150
|
+
// ✅ Good
|
|
151
|
+
html`<sp-theme color="light"></sp-theme>`;
|
|
152
|
+
html`<sp-button variant="accent">Click</sp-button>`;
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### `swc/valid-slot-names`
|
|
156
|
+
|
|
157
|
+
Warn when a child element targets a slot that the parent component doesn't define.
|
|
158
|
+
|
|
159
|
+
```js
|
|
160
|
+
// ❌ Bad — Lit
|
|
161
|
+
html`<sp-action-menu label="Actions">
|
|
162
|
+
<sp-menu-item slot="header">Edit</sp-menu-item>
|
|
163
|
+
</sp-action-menu>`;
|
|
164
|
+
|
|
165
|
+
// ❌ Bad — JSX
|
|
166
|
+
<SpActionMenu label="Actions">
|
|
167
|
+
<SpMenuItem slot="header">Edit</SpMenuItem>
|
|
168
|
+
</SpActionMenu>
|
|
169
|
+
|
|
170
|
+
// ✅ Good — Lit
|
|
171
|
+
html`<sp-action-menu label="Actions">
|
|
172
|
+
<sp-menu-item>Edit</sp-menu-item>
|
|
173
|
+
<sp-icon slot="icon"></sp-icon>
|
|
174
|
+
</sp-action-menu>`;
|
|
175
|
+
|
|
176
|
+
// ✅ Good — JSX
|
|
177
|
+
<SpActionMenu label="Actions">
|
|
178
|
+
<SpMenuItem>Edit</SpMenuItem>
|
|
179
|
+
<SpIcon slot="icon"></SpIcon>
|
|
180
|
+
</SpActionMenu>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### `swc/valid-slot-children`
|
|
184
|
+
|
|
185
|
+
Warn when a child element's tag is not accepted in the slot it targets.
|
|
186
|
+
|
|
187
|
+
```js
|
|
188
|
+
// ❌ Bad — Lit (sp-action-menu default slot only accepts sp-menu-item/group/divider)
|
|
189
|
+
html`<sp-action-menu label="Actions">
|
|
190
|
+
<sp-button>Wrong child</sp-button>
|
|
191
|
+
</sp-action-menu>`;
|
|
192
|
+
|
|
193
|
+
// ❌ Bad — JSX
|
|
194
|
+
<SpActionMenu label="Actions">
|
|
195
|
+
<SpButton>Wrong child</SpButton>
|
|
196
|
+
</SpActionMenu>
|
|
197
|
+
|
|
198
|
+
// ✅ Good — Lit
|
|
199
|
+
html`<sp-action-menu label="Actions">
|
|
200
|
+
<sp-menu-item>Edit</sp-menu-item>
|
|
201
|
+
<sp-menu-divider></sp-menu-divider>
|
|
202
|
+
<sp-menu-item>Delete</sp-menu-item>
|
|
203
|
+
</sp-action-menu>`;
|
|
204
|
+
|
|
205
|
+
// ✅ Good — JSX
|
|
206
|
+
<SpActionMenu label="Actions">
|
|
207
|
+
<SpMenuItem>Edit</SpMenuItem>
|
|
208
|
+
<SpMenuDivider></SpMenuDivider>
|
|
209
|
+
<SpMenuItem>Delete</SpMenuItem>
|
|
210
|
+
</SpActionMenu>
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
| Component | Default slot accepts | Named slots |
|
|
214
|
+
|---|---|---|
|
|
215
|
+
| `<sp-action-menu>` | `sp-menu-item`, `sp-menu-group`, `sp-menu-divider` | `icon`, `label`, `tooltip` |
|
|
216
|
+
| `<sp-picker>` | `sp-menu-item`, `sp-menu-group`, `sp-menu-divider` | `label`, `tooltip`, `description` |
|
|
217
|
+
| `<sp-tabs>` | `sp-tab`, `sp-tab-panel` | — |
|
|
218
|
+
| `<sp-button>` | (any) | `icon` (accepts `sp-icon`) |
|
|
219
|
+
| `<sp-dialog-wrapper>` | (any) | `hero`, `heading`, `button` (accepts `sp-button`) |
|
|
220
|
+
| `<overlay-trigger>` | (any) | `click-content`, `hover-content`, `longpress-content` |
|
|
221
|
+
|
|
222
|
+
## Architecture
|
|
223
|
+
|
|
224
|
+
This plugin is **data-driven**. Rules are generated from component descriptors rather than hand-written per component:
|
|
225
|
+
|
|
226
|
+
```
|
|
227
|
+
src/
|
|
228
|
+
├── adapters/ # Template syntax parsers
|
|
229
|
+
│ ├── lit-adapter.ts # Extracts elements from html`` tagged templates
|
|
230
|
+
│ ├── jsx-adapter.ts # Extracts elements from JSX/TSX (PascalCase + kebab-case)
|
|
231
|
+
│ └── utils.ts # Shared utilities (pascalToKebab, camelToKebab, etc.)
|
|
232
|
+
├── core/
|
|
233
|
+
│ ├── types.ts # Normalized IR (ParsedElement, descriptors)
|
|
234
|
+
│ └── rule-factory.ts # Generates ESLint rules from descriptors (dual-visitor)
|
|
235
|
+
├── descriptors/
|
|
236
|
+
│ └── components.ts # Component accessibility/deprecation metadata
|
|
237
|
+
├── rules/ # Thin wrappers: factory(descriptors)
|
|
238
|
+
└── index.ts # Plugin entry with recommended/strict configs
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Adding a new component
|
|
242
|
+
|
|
243
|
+
Add an entry to `src/descriptors/components.ts`:
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
'sp-new-component': {
|
|
247
|
+
tagName: 'sp-new-component',
|
|
248
|
+
accessibility: {
|
|
249
|
+
requireOneOf: ['label', 'aria-label', 'aria-labelledby'],
|
|
250
|
+
},
|
|
251
|
+
validAttributeValues: {
|
|
252
|
+
variant: ['primary', 'secondary'],
|
|
253
|
+
},
|
|
254
|
+
slots: [
|
|
255
|
+
{ name: '', acceptedChildren: ['sp-menu-item'] },
|
|
256
|
+
{ name: 'icon', acceptedChildren: ['sp-icon'] },
|
|
257
|
+
],
|
|
258
|
+
}
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
No new rule code needed — the rule factory picks it up automatically.
|
|
262
|
+
|
|
263
|
+
### JSX naming conventions
|
|
264
|
+
|
|
265
|
+
The JSX adapter supports two usage patterns:
|
|
266
|
+
|
|
267
|
+
| Pattern | Example | Resolves to |
|
|
268
|
+
|---|---|---|
|
|
269
|
+
| Kebab-case (direct CE usage) | `<sp-action-menu>` | `sp-action-menu` |
|
|
270
|
+
| PascalCase (React wrapper) | `<SpActionMenu>` | `sp-action-menu` |
|
|
271
|
+
|
|
272
|
+
CamelCase props are automatically converted to their kebab-case attribute equivalents:
|
|
273
|
+
- `ariaLabel` → `aria-label`
|
|
274
|
+
- `isDecorative` → `is-decorative`
|
|
275
|
+
- `allowOutsideClick` → `allow-outside-click`
|
|
276
|
+
|
|
277
|
+
### Adding a new template syntax
|
|
278
|
+
|
|
279
|
+
Create a new adapter in `src/adapters/` that returns `ParsedElement[]` from the relevant AST node type, then register its visitor in `rule-factory.ts`. The rule logic is template-agnostic.
|
|
280
|
+
|
|
281
|
+
## Configs
|
|
282
|
+
|
|
283
|
+
| Config | Severity | Use case |
|
|
284
|
+
|---|---|---|
|
|
285
|
+
| `swc.configs.recommended` | `warn` | Incremental adoption, developer experience |
|
|
286
|
+
| `swc.configs.strict` | `error` | CI enforcement, blocking on violations |
|
|
287
|
+
|
|
288
|
+
## Dynamic values
|
|
289
|
+
|
|
290
|
+
The plugin **skips** attributes with dynamic template expressions since they can't be statically verified:
|
|
291
|
+
|
|
292
|
+
```js
|
|
293
|
+
// No warning — Lit dynamic value
|
|
294
|
+
html`<sp-action-menu label=${this.label}></sp-action-menu>`;
|
|
295
|
+
|
|
296
|
+
// No warning — JSX dynamic value
|
|
297
|
+
<SpActionMenu label={this.label}></SpActionMenu>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## Related
|
|
301
|
+
|
|
302
|
+
- [Spectrum Web Components](https://opensource.adobe.com/spectrum-web-components/) — the component library
|
|
303
|
+
- [eslint-plugin-lit-a11y](https://github.com/open-wc/open-wc/tree/master/packages/eslint-plugin-lit-a11y) — generic Lit accessibility rules
|
|
304
|
+
- [axe-core](https://github.com/dequelabs/axe-core) — runtime accessibility testing
|
|
305
|
+
- [Alex Hayton's eslint-plugin-spectrum-web-components-lit](https://github.com/AlexHayton/eslint-plugin-spectrum-web-components-lit) — the original inspiration
|
|
306
|
+
|
|
307
|
+
## License
|
|
308
|
+
|
|
309
|
+
Apache-2.0
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import type { Rule } from 'eslint';
|
|
13
|
+
import type { ParsedElement } from '../core/types.js';
|
|
14
|
+
/**
|
|
15
|
+
* Extract a ParsedElement from a JSXElement AST node.
|
|
16
|
+
* Returns an empty array if not an SWC element.
|
|
17
|
+
* Recursively extracts direct children for slot validation.
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractElementFromJSX(node: Rule.Node): ParsedElement[];
|
|
20
|
+
//# sourceMappingURL=jsx-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/jsx-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,KAAK,EAAkB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAsKtE;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,aAAa,EAAE,CAkCtE"}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2026 Adobe. All rights reserved.
|
|
3
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
6
|
+
*
|
|
7
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
8
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
9
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
10
|
+
* governing permissions and limitations under the License.
|
|
11
|
+
*/
|
|
12
|
+
import { camelToKebab, isSwcJsxTag, resolveJsxTagName } from './utils.js';
|
|
13
|
+
/**
|
|
14
|
+
* Resolve a JSX element's name node to a plain string.
|
|
15
|
+
* Handles both `<SpButton>` (JSXIdentifier) and `<Sp.Button>` (JSXMemberExpression).
|
|
16
|
+
*/
|
|
17
|
+
function getJsxElementName(nameNode) {
|
|
18
|
+
if (nameNode.type === 'JSXIdentifier') {
|
|
19
|
+
return nameNode.name;
|
|
20
|
+
}
|
|
21
|
+
if (nameNode.type === 'JSXMemberExpression') {
|
|
22
|
+
const parts = [];
|
|
23
|
+
let current = nameNode;
|
|
24
|
+
while (current.type === 'JSXMemberExpression') {
|
|
25
|
+
parts.unshift(current.property.name);
|
|
26
|
+
current = current.object;
|
|
27
|
+
}
|
|
28
|
+
parts.unshift(current.name);
|
|
29
|
+
return parts.join('.');
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Determine if an attribute name is already kebab-case (contains a hyphen)
|
|
35
|
+
* meaning it doesn't need conversion.
|
|
36
|
+
*/
|
|
37
|
+
function isKebabCase(name) {
|
|
38
|
+
return name.includes('-');
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Normalize a JSX attribute name to its HTML attribute equivalent.
|
|
42
|
+
* If the prop is already kebab-case (e.g. `aria-label`), keep as-is.
|
|
43
|
+
* Otherwise convert camelCase to kebab-case.
|
|
44
|
+
*/
|
|
45
|
+
function normalizeAttributeName(jsxPropName) {
|
|
46
|
+
if (isKebabCase(jsxPropName))
|
|
47
|
+
return jsxPropName;
|
|
48
|
+
return camelToKebab(jsxPropName);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Extract attributes from a JSXOpeningElement into a normalized map.
|
|
52
|
+
*/
|
|
53
|
+
function extractAttributes(opening) {
|
|
54
|
+
const attributes = new Map();
|
|
55
|
+
for (const attr of opening.attributes) {
|
|
56
|
+
if (attr.type === 'JSXSpreadAttribute') {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const propName = attr.name.name;
|
|
60
|
+
const htmlName = normalizeAttributeName(propName);
|
|
61
|
+
if (attr.value === null) {
|
|
62
|
+
attributes.set(htmlName, { value: '', isDynamic: false });
|
|
63
|
+
}
|
|
64
|
+
else if (attr.value.type === 'Literal') {
|
|
65
|
+
const raw = attr.value.value === null ? '' : String(attr.value.value);
|
|
66
|
+
attributes.set(htmlName, { value: raw, isDynamic: false });
|
|
67
|
+
}
|
|
68
|
+
else if (attr.value.type === 'JSXExpressionContainer') {
|
|
69
|
+
attributes.set(htmlName, { value: null, isDynamic: true });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return attributes;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Recursively extract child ParsedElements from JSX children.
|
|
76
|
+
* Includes all element children so slot validation can check non-SWC tags too.
|
|
77
|
+
*/
|
|
78
|
+
function extractChildElements(children) {
|
|
79
|
+
const results = [];
|
|
80
|
+
for (const child of children) {
|
|
81
|
+
if (child.type !== 'JSXElement' || !child.openingElement)
|
|
82
|
+
continue;
|
|
83
|
+
const rawName = getJsxElementName(child.openingElement.name);
|
|
84
|
+
if (!rawName)
|
|
85
|
+
continue;
|
|
86
|
+
const isSwc = isSwcJsxTag(rawName);
|
|
87
|
+
const tagName = isSwc ? resolveJsxTagName(rawName) : rawName;
|
|
88
|
+
const attributes = extractAttributes(child.openingElement);
|
|
89
|
+
const grandchildren = child.children
|
|
90
|
+
? extractChildElements(child.children)
|
|
91
|
+
: [];
|
|
92
|
+
let hasTextContent = false;
|
|
93
|
+
if (child.children) {
|
|
94
|
+
for (const grandchild of child.children) {
|
|
95
|
+
if (grandchild.type === 'JSXText') {
|
|
96
|
+
const text = (grandchild.value ?? '').trim();
|
|
97
|
+
if (text.length > 0) {
|
|
98
|
+
hasTextContent = true;
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
results.push({
|
|
105
|
+
tagName,
|
|
106
|
+
attributes,
|
|
107
|
+
children: grandchildren,
|
|
108
|
+
hasTextContent,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
return results;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Extract a ParsedElement from a JSXElement AST node.
|
|
115
|
+
* Returns an empty array if not an SWC element.
|
|
116
|
+
* Recursively extracts direct children for slot validation.
|
|
117
|
+
*/
|
|
118
|
+
export function extractElementFromJSX(node) {
|
|
119
|
+
const jsxNode = node;
|
|
120
|
+
const opening = jsxNode.openingElement;
|
|
121
|
+
const rawName = getJsxElementName(opening.name);
|
|
122
|
+
if (!rawName || !isSwcJsxTag(rawName))
|
|
123
|
+
return [];
|
|
124
|
+
const tagName = resolveJsxTagName(rawName);
|
|
125
|
+
const attributes = extractAttributes(opening);
|
|
126
|
+
const children = jsxNode.children
|
|
127
|
+
? extractChildElements(jsxNode.children)
|
|
128
|
+
: [];
|
|
129
|
+
let hasTextContent = false;
|
|
130
|
+
if (jsxNode.children) {
|
|
131
|
+
for (const child of jsxNode.children) {
|
|
132
|
+
if (child.type === 'JSXText') {
|
|
133
|
+
const text = (child.value ?? '').trim();
|
|
134
|
+
if (text.length > 0) {
|
|
135
|
+
hasTextContent = true;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return [
|
|
142
|
+
{
|
|
143
|
+
tagName,
|
|
144
|
+
attributes,
|
|
145
|
+
children,
|
|
146
|
+
hasTextContent,
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=jsx-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-adapter.js","sourceRoot":"","sources":["../../src/adapters/jsx-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAgD1E;;;GAGG;AACH,SAAS,iBAAiB,CACxB,QAA6C;IAE7C,IAAI,QAAQ,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACtC,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;IAED,IAAI,QAAQ,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;QAC5C,MAAM,KAAK,GAAa,EAAE,CAAC;QAC3B,IAAI,OAAO,GAAwC,QAAQ,CAAC;QAC5D,OAAO,OAAO,CAAC,IAAI,KAAK,qBAAqB,EAAE,CAAC;YAC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