web-components-doctor 0.1.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.
Files changed (39) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +173 -0
  3. package/dist/adapters/lit-adapter.d.ts +19 -0
  4. package/dist/adapters/lit-adapter.d.ts.map +1 -0
  5. package/dist/adapters/lit-adapter.js +145 -0
  6. package/dist/adapters/lit-adapter.js.map +1 -0
  7. package/dist/core/rule-factory.d.ts +34 -0
  8. package/dist/core/rule-factory.d.ts.map +1 -0
  9. package/dist/core/rule-factory.js +297 -0
  10. package/dist/core/rule-factory.js.map +1 -0
  11. package/dist/core/types.d.ts +92 -0
  12. package/dist/core/types.d.ts.map +1 -0
  13. package/dist/core/types.js +13 -0
  14. package/dist/core/types.js.map +1 -0
  15. package/dist/descriptors/components.d.ts +21 -0
  16. package/dist/descriptors/components.d.ts.map +1 -0
  17. package/dist/descriptors/components.js +202 -0
  18. package/dist/descriptors/components.js.map +1 -0
  19. package/dist/index.d.ts +37 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +69 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/rules/accessible-component.d.ts +13 -0
  24. package/dist/rules/accessible-component.d.ts.map +1 -0
  25. package/dist/rules/accessible-component.js +15 -0
  26. package/dist/rules/accessible-component.js.map +1 -0
  27. package/dist/rules/no-deprecated.d.ts +13 -0
  28. package/dist/rules/no-deprecated.d.ts.map +1 -0
  29. package/dist/rules/no-deprecated.js +15 -0
  30. package/dist/rules/no-deprecated.js.map +1 -0
  31. package/dist/rules/required-attributes.d.ts +13 -0
  32. package/dist/rules/required-attributes.d.ts.map +1 -0
  33. package/dist/rules/required-attributes.js +15 -0
  34. package/dist/rules/required-attributes.js.map +1 -0
  35. package/dist/rules/valid-attribute-values.d.ts +13 -0
  36. package/dist/rules/valid-attribute-values.d.ts.map +1 -0
  37. package/dist/rules/valid-attribute-values.js +15 -0
  38. package/dist/rules/valid-attribute-values.js.map +1 -0
  39. package/package.json +62 -0
@@ -0,0 +1,37 @@
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 { ESLint, Linter } from 'eslint';
13
+ declare const rules: {
14
+ 'accessible-component': import("eslint").Rule.RuleModule;
15
+ 'no-deprecated': import("eslint").Rule.RuleModule;
16
+ 'required-attributes': import("eslint").Rule.RuleModule;
17
+ 'valid-attribute-values': import("eslint").Rule.RuleModule;
18
+ };
19
+ declare const plugin: ESLint.Plugin;
20
+ /**
21
+ * Flat configs for ESLint 9+ (eslint.config.js).
22
+ *
23
+ * @example
24
+ * ```js
25
+ * import swc from 'eslint-plugin-swc';
26
+ *
27
+ * export default [
28
+ * swc.configs.recommended,
29
+ * // or swc.configs.strict
30
+ * ];
31
+ * ```
32
+ */
33
+ declare const configs: Record<string, Linter.Config>;
34
+ export default plugin;
35
+ export { rules, configs };
36
+ export type { ComponentDescriptor, ComponentDescriptorMap } from './core/types.js';
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAQ7C,QAAA,MAAM,KAAK;;;;;CAKV,CAAC;AAgBF,QAAA,MAAM,MAAM,EAAE,MAAM,CAAC,MAOpB,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAS1C,CAAC;AAIF,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC1B,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,69 @@
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 { accessibleComponent } from './rules/accessible-component.js';
13
+ import { noDeprecated } from './rules/no-deprecated.js';
14
+ import { requiredAttributes } from './rules/required-attributes.js';
15
+ import { validAttributeValues } from './rules/valid-attribute-values.js';
16
+ const PLUGIN_NAME = 'swc';
17
+ const rules = {
18
+ 'accessible-component': accessibleComponent,
19
+ 'no-deprecated': noDeprecated,
20
+ 'required-attributes': requiredAttributes,
21
+ 'valid-attribute-values': validAttributeValues,
22
+ };
23
+ const recommendedRules = {
24
+ [`${PLUGIN_NAME}/accessible-component`]: 'warn',
25
+ [`${PLUGIN_NAME}/no-deprecated`]: 'warn',
26
+ [`${PLUGIN_NAME}/required-attributes`]: 'warn',
27
+ [`${PLUGIN_NAME}/valid-attribute-values`]: 'warn',
28
+ };
29
+ const strictRules = {
30
+ [`${PLUGIN_NAME}/accessible-component`]: 'error',
31
+ [`${PLUGIN_NAME}/no-deprecated`]: 'error',
32
+ [`${PLUGIN_NAME}/required-attributes`]: 'error',
33
+ [`${PLUGIN_NAME}/valid-attribute-values`]: 'error',
34
+ };
35
+ const plugin = {
36
+ meta: {
37
+ name: 'web-components-doctor',
38
+ version: '0.1.0',
39
+ },
40
+ rules,
41
+ configs: {},
42
+ };
43
+ /**
44
+ * Flat configs for ESLint 9+ (eslint.config.js).
45
+ *
46
+ * @example
47
+ * ```js
48
+ * import swc from 'eslint-plugin-swc';
49
+ *
50
+ * export default [
51
+ * swc.configs.recommended,
52
+ * // or swc.configs.strict
53
+ * ];
54
+ * ```
55
+ */
56
+ const configs = {
57
+ recommended: {
58
+ plugins: { [PLUGIN_NAME]: plugin },
59
+ rules: recommendedRules,
60
+ },
61
+ strict: {
62
+ plugins: { [PLUGIN_NAME]: plugin },
63
+ rules: strictRules,
64
+ },
65
+ };
66
+ plugin.configs = configs;
67
+ export default plugin;
68
+ export { rules, configs };
69
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE,MAAM,WAAW,GAAG,KAAK,CAAC;AAE1B,MAAM,KAAK,GAAG;IACZ,sBAAsB,EAAE,mBAAmB;IAC3C,eAAe,EAAE,YAAY;IAC7B,qBAAqB,EAAE,kBAAkB;IACzC,wBAAwB,EAAE,oBAAoB;CAC/C,CAAC;AAEF,MAAM,gBAAgB,GAAuB;IAC3C,CAAC,GAAG,WAAW,uBAAuB,CAAC,EAAE,MAAM;IAC/C,CAAC,GAAG,WAAW,gBAAgB,CAAC,EAAE,MAAM;IACxC,CAAC,GAAG,WAAW,sBAAsB,CAAC,EAAE,MAAM;IAC9C,CAAC,GAAG,WAAW,yBAAyB,CAAC,EAAE,MAAM;CAClD,CAAC;AAEF,MAAM,WAAW,GAAuB;IACtC,CAAC,GAAG,WAAW,uBAAuB,CAAC,EAAE,OAAO;IAChD,CAAC,GAAG,WAAW,gBAAgB,CAAC,EAAE,OAAO;IACzC,CAAC,GAAG,WAAW,sBAAsB,CAAC,EAAE,OAAO;IAC/C,CAAC,GAAG,WAAW,yBAAyB,CAAC,EAAE,OAAO;CACnD,CAAC;AAEF,MAAM,MAAM,GAAkB;IAC5B,IAAI,EAAE;QACJ,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,OAAO;KACjB;IACD,KAAK;IACL,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,GAAkC;IAC7C,WAAW,EAAE;QACX,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE;QAClC,KAAK,EAAE,gBAAgB;KACxB;IACD,MAAM,EAAE;QACN,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE;QAClC,KAAK,EAAE,WAAW;KACnB;CACF,CAAC;AAEF,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC;AAEzB,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC"}
@@ -0,0 +1,13 @@
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
+ export declare const accessibleComponent: import("eslint").Rule.RuleModule;
13
+ //# sourceMappingURL=accessible-component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessible-component.d.ts","sourceRoot":"","sources":["../../src/rules/accessible-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,eAAO,MAAM,mBAAmB,kCACqB,CAAC"}
@@ -0,0 +1,15 @@
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 { createAccessibleComponentRule } from '../core/rule-factory.js';
13
+ import { componentDescriptors } from '../descriptors/components.js';
14
+ export const accessibleComponent = createAccessibleComponentRule(componentDescriptors);
15
+ //# sourceMappingURL=accessible-component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessible-component.js","sourceRoot":"","sources":["../../src/rules/accessible-component.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM,mBAAmB,GAC9B,6BAA6B,CAAC,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
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
+ export declare const noDeprecated: import("eslint").Rule.RuleModule;
13
+ //# sourceMappingURL=no-deprecated.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-deprecated.d.ts","sourceRoot":"","sources":["../../src/rules/no-deprecated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,eAAO,MAAM,YAAY,kCAA+C,CAAC"}
@@ -0,0 +1,15 @@
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 { createNoDeprecatedRule } from '../core/rule-factory.js';
13
+ import { componentDescriptors } from '../descriptors/components.js';
14
+ export const noDeprecated = createNoDeprecatedRule(componentDescriptors);
15
+ //# sourceMappingURL=no-deprecated.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"no-deprecated.js","sourceRoot":"","sources":["../../src/rules/no-deprecated.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM,YAAY,GAAG,sBAAsB,CAAC,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
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
+ export declare const requiredAttributes: import("eslint").Rule.RuleModule;
13
+ //# sourceMappingURL=required-attributes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-attributes.d.ts","sourceRoot":"","sources":["../../src/rules/required-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,eAAO,MAAM,kBAAkB,kCACqB,CAAC"}
@@ -0,0 +1,15 @@
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 { createRequiredAttributesRule } from '../core/rule-factory.js';
13
+ import { componentDescriptors } from '../descriptors/components.js';
14
+ export const requiredAttributes = createRequiredAttributesRule(componentDescriptors);
15
+ //# sourceMappingURL=required-attributes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-attributes.js","sourceRoot":"","sources":["../../src/rules/required-attributes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM,kBAAkB,GAC7B,4BAA4B,CAAC,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,13 @@
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
+ export declare const validAttributeValues: import("eslint").Rule.RuleModule;
13
+ //# sourceMappingURL=valid-attribute-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valid-attribute-values.d.ts","sourceRoot":"","sources":["../../src/rules/valid-attribute-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH,eAAO,MAAM,oBAAoB,kCACqB,CAAC"}
@@ -0,0 +1,15 @@
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 { createValidAttributeValuesRule } from '../core/rule-factory.js';
13
+ import { componentDescriptors } from '../descriptors/components.js';
14
+ export const validAttributeValues = createValidAttributeValuesRule(componentDescriptors);
15
+ //# sourceMappingURL=valid-attribute-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"valid-attribute-values.js","sourceRoot":"","sources":["../../src/rules/valid-attribute-values.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,MAAM,CAAC,MAAM,oBAAoB,GAC/B,8BAA8B,CAAC,oBAAoB,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "web-components-doctor",
3
+ "version": "0.1.0",
4
+ "description": "ESLint plugin for Spectrum Web Components — catches accessibility gaps, deprecated APIs, and invalid attribute usage at lint time.",
5
+ "license": "Apache-2.0",
6
+ "author": "Adobe",
7
+ "type": "module",
8
+ "exports": {
9
+ ".": {
10
+ "import": "./dist/index.js",
11
+ "types": "./dist/index.d.ts"
12
+ }
13
+ },
14
+ "main": "dist/index.js",
15
+ "types": "dist/index.d.ts",
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsc",
21
+ "prepublishOnly": "npm run build",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest",
24
+ "lint": "eslint src/ tests/",
25
+ "typecheck": "tsc --noEmit"
26
+ },
27
+ "peerDependencies": {
28
+ "eslint": ">=8.0.0"
29
+ },
30
+ "dependencies": {
31
+ "parse5": "^7.2.1"
32
+ },
33
+ "devDependencies": {
34
+ "@typescript-eslint/rule-tester": "^8.24.0",
35
+ "@typescript-eslint/utils": "^8.24.0",
36
+ "eslint": "^9.20.0",
37
+ "typescript": "^5.7.3",
38
+ "vitest": "^3.0.5"
39
+ },
40
+ "keywords": [
41
+ "eslint",
42
+ "eslintplugin",
43
+ "spectrum",
44
+ "adobe",
45
+ "web-components",
46
+ "accessibility",
47
+ "lit",
48
+ "a11y",
49
+ "spectrum-web-components"
50
+ ],
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "https://github.com/Rajdeepc/web-components-doctor.git"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/Rajdeepc/web-components-doctor/issues"
57
+ },
58
+ "homepage": "https://github.com/Rajdeepc/web-components-doctor#readme",
59
+ "engines": {
60
+ "node": ">=18.0.0"
61
+ }
62
+ }