Skip to content

Commit 224c04c

Browse files
authored
Merge pull request #104 from github/upgrade-to-new-web-component-standards
upgrade to new web component standards
2 parents 9fbf2e6 + e6dea43 commit 224c04c

18 files changed

+11027
-3451
lines changed

.eslintrc.json

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,40 @@
11
{
22
"root": true,
3-
"plugins": ["custom-elements"],
43
"extends": [
54
"plugin:github/browser",
65
"plugin:github/recommended",
76
"plugin:github/typescript",
87
"plugin:custom-elements/recommended"
98
],
109
"rules": {
11-
"github/no-then": "off",
12-
"no-invalid-this": "off",
13-
"custom-elements/tag-name-matches-class": ["error", {"suffix": "Element"}],
10+
"custom-elements/tag-name-matches-class": [
11+
"error",
12+
{
13+
"suffix": "Element"
14+
}
15+
],
16+
"custom-elements/define-tag-after-class-definition": "off",
17+
"custom-elements/no-method-prefixed-with-on": "off",
18+
"custom-elements/expose-class-on-global": "off",
1419
"import/extensions": ["error", "always"],
1520
"import/no-unresolved": "off"
1621
},
17-
"globals": {
18-
"AutocompleteElement": "readonly"
19-
},
20-
"ignorePatterns": ["dist/", "examples/dist"],
2122
"overrides": [
2223
{
23-
"files": ["test/*.js", "rollup.config.js"],
24-
"parser": "espree",
25-
"parserOptions": {
26-
"ecmaVersion": 8
27-
},
24+
"files": "src/*-define.ts",
2825
"rules": {
29-
"github/unescaped-html-literal": "off"
26+
"@typescript-eslint/no-namespace": "off"
3027
}
3128
},
3229
{
3330
"files": "test/**/*.js",
34-
"excludedFiles": "test/karma.config.js",
31+
"rules": {
32+
"github/unescaped-html-literal": "off",
33+
"github/no-inner-html": "off",
34+
"i18n-text/no-en": "off"
35+
},
3536
"env": {
3637
"mocha": true
37-
},
38-
"globals": {
39-
"assert": true
40-
}
41-
},
42-
{
43-
"files": "validator.js",
44-
"rules": {
45-
"@typescript-eslint/explicit-module-boundary-types": "off"
46-
}
47-
},
48-
{
49-
"files": ["*.config.js"],
50-
"rules": {
51-
"filenames/match-regex": "off"
5238
}
5339
}
5440
]

custom-elements-manifest.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default {
2+
packagejson: true,
3+
globs: ['src/*-element.ts'],
4+
plugins: [],
5+
}

custom-elements.json

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
{
2+
"schemaVersion": "1.0.0",
3+
"readme": "",
4+
"modules": [
5+
{
6+
"kind": "javascript-module",
7+
"path": "src/auto-complete-element.ts",
8+
"declarations": [
9+
{
10+
"kind": "class",
11+
"description": "",
12+
"name": "AutocompleteElement",
13+
"members": [
14+
{
15+
"kind": "method",
16+
"name": "setCSPTrustedTypesPolicy",
17+
"static": true,
18+
"return": {
19+
"type": {
20+
"text": "void"
21+
}
22+
},
23+
"parameters": [
24+
{
25+
"name": "policy",
26+
"type": {
27+
"text": "CSPTrustedTypesPolicy | Promise<CSPTrustedTypesPolicy> | null"
28+
}
29+
}
30+
]
31+
},
32+
{
33+
"kind": "field",
34+
"name": "#forElement",
35+
"privacy": "private",
36+
"type": {
37+
"text": "HTMLElement | null"
38+
},
39+
"default": "null"
40+
},
41+
{
42+
"kind": "field",
43+
"name": "forElement",
44+
"type": {
45+
"text": "HTMLElement | null"
46+
}
47+
},
48+
{
49+
"kind": "field",
50+
"name": "#inputElement",
51+
"privacy": "private",
52+
"type": {
53+
"text": "HTMLInputElement | null"
54+
},
55+
"default": "null"
56+
},
57+
{
58+
"kind": "field",
59+
"name": "inputElement",
60+
"type": {
61+
"text": "HTMLInputElement | null"
62+
}
63+
},
64+
{
65+
"kind": "method",
66+
"name": "#reattachState"
67+
},
68+
{
69+
"kind": "field",
70+
"name": "src",
71+
"type": {
72+
"text": "string"
73+
}
74+
},
75+
{
76+
"kind": "field",
77+
"name": "value",
78+
"type": {
79+
"text": "string"
80+
}
81+
},
82+
{
83+
"kind": "field",
84+
"name": "open",
85+
"type": {
86+
"text": "boolean"
87+
}
88+
},
89+
{
90+
"kind": "field",
91+
"name": "fetchOnEmpty",
92+
"type": {
93+
"text": "boolean"
94+
}
95+
},
96+
{
97+
"kind": "field",
98+
"name": "#requestController",
99+
"privacy": "private",
100+
"type": {
101+
"text": "AbortController | undefined"
102+
}
103+
},
104+
{
105+
"kind": "method",
106+
"name": "fetchResult",
107+
"return": {
108+
"type": {
109+
"text": "Promise<string | CSPTrustedHTMLToStringable>"
110+
}
111+
},
112+
"parameters": [
113+
{
114+
"name": "url",
115+
"type": {
116+
"text": "URL"
117+
}
118+
}
119+
]
120+
}
121+
],
122+
"events": [
123+
{
124+
"name": "auto-complete-change",
125+
"type": {
126+
"text": "AutocompleteEvent"
127+
}
128+
}
129+
],
130+
"attributes": [
131+
{
132+
"name": "open"
133+
},
134+
{
135+
"name": "value"
136+
},
137+
{
138+
"name": "for"
139+
}
140+
],
141+
"superclass": {
142+
"name": "HTMLElement"
143+
},
144+
"tagName": "auto-complete",
145+
"customElement": true
146+
}
147+
],
148+
"exports": [
149+
{
150+
"kind": "js",
151+
"name": "default",
152+
"declaration": {
153+
"name": "AutocompleteElement",
154+
"module": "src/auto-complete-element.ts"
155+
}
156+
},
157+
{
158+
"kind": "custom-element-definition",
159+
"name": "auto-complete",
160+
"declaration": {
161+
"name": "AutocompleteElement",
162+
"module": "src/auto-complete-element.ts"
163+
}
164+
}
165+
]
166+
}
167+
]
168+
}

karma.config.cjs

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy