Skip to content

Commit 5528428

Browse files
committed
fix lint
1 parent 1f44bb3 commit 5528428

File tree

94 files changed

+2309
-2307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2309
-2307
lines changed

eslint.config.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default [
1515

1616
rules: {
1717
// Semicolons required
18-
"semi": ["error", "always"],
18+
"semi": ["error", "never"],
1919

2020
// 2 space indentation
2121
"indent": ["error", 2],
@@ -25,10 +25,12 @@ export default [
2525
"no-undef": "off",
2626

2727
// Style: double quotes
28-
"quotes": ["error", "double"],
28+
"quotes": ["error", "single"],
2929

3030
// No trailing commas
31-
"comma-dangle": ["error", "never"]
31+
"comma-dangle": ["error", "never"],
32+
33+
"no-multi-spaces": "error"
3234
}
3335
}
3436

src/E/e-for-each-template.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,86 @@
1-
import getNodeScopedState from "#ehtml/getNodeScopedState.js?v=41ab2bfa";
2-
import setNodeScopedState from "#ehtml/setNodeScopedState.js?v=7806d68f";
3-
import evaluatedValueWithParamsFromState from "#ehtml/evaluatedValueWithParamsFromState.js?v=a8e84941";
1+
import getNodeScopedState from '#ehtml/getNodeScopedState.js?v=41ab2bfa'
2+
import setNodeScopedState from '#ehtml/setNodeScopedState.js?v=7806d68f'
3+
import evaluatedValueWithParamsFromState from '#ehtml/evaluatedValueWithParamsFromState.js?v=a8e84941'
44

55
export default class EForEachTemplate extends HTMLTemplateElement {
66
constructor () {
7-
super();
8-
this.ehtmlActivated = false;
7+
super()
8+
this.ehtmlActivated = false
99
}
1010

1111
connectedCallback () {
12-
this.addEventListener("ehtml:activated", this.onEHTMLActivated, { once: true });
12+
this.addEventListener('ehtml:activated', this.onEHTMLActivated, { once: true })
1313
}
1414

1515
onEHTMLActivated () {
1616
if (this.ehtmlActivated) {
17-
return;
17+
return
1818
}
19-
this.ehtmlActivated = true;
20-
this.run();
19+
this.ehtmlActivated = true
20+
this.run()
2121
}
2222

2323
run () {
24-
const listExpr = this.getAttribute("data-list-to-iterate");
25-
const itemName = this.getAttribute("data-item-name");
24+
const listExpr = this.getAttribute('data-list-to-iterate')
25+
const itemName = this.getAttribute('data-item-name')
2626

2727
if (!listExpr) {
28-
throw new Error("<template is=\"e-for-each\"> must have data-list-to-iterate");
28+
throw new Error('<template is="e-for-each"> must have data-list-to-iterate')
2929
}
3030

3131
if (!itemName) {
32-
throw new Error("<template is=\"e-for-each\"> must have data-item-name");
32+
throw new Error('<template is="e-for-each"> must have data-item-name')
3333
}
3434

3535
// 1. Get inherited lexical state at this <template>
36-
const state = getNodeScopedState(this);
36+
const state = getNodeScopedState(this)
3737

3838
// 2. Evaluate the list expression
3939
const list = evaluatedValueWithParamsFromState(
40-
listExpr.replace(/\n/g, " "),
40+
listExpr.replace(/\n/g, ' '),
4141
state,
4242
this
43-
);
43+
)
4444

4545
if (!Array.isArray(list)) {
46-
throw new Error("data-list-to-iterate must evaluate to an array");
46+
throw new Error('data-list-to-iterate must evaluate to an array')
4747
}
4848

4949
// 3. Prepare fragment to insert
50-
const fragment = document.createDocumentFragment();
50+
const fragment = document.createDocumentFragment()
5151

5252
list.forEach((item, index) => {
5353
// Add index if not set
54-
if (typeof item === "object" && item.index === undefined) {
55-
item.index = index + 1;
54+
if (typeof item === 'object' && item.index === undefined) {
55+
item.index = index + 1
5656
}
5757

5858
// Clone inert DOM from template
59-
const cloned = this.content.cloneNode(true);
59+
const cloned = this.content.cloneNode(true)
6060

6161
// 4. Build item-level state (lexical extension)
6262
const itemState = {
6363
...state,
6464
[itemName]: item
65-
};
65+
}
6666

6767
// 5. Assign the new lexical state to this *iteration wrapper*
6868
//
6969
// Since `cloned` is a DocumentFragment of the template content,
7070
// we assign state to each root element in it.
7171
for (const child of cloned.childNodes) {
7272
if (child.nodeType === 1) {
73-
setNodeScopedState(child, itemState);
73+
setNodeScopedState(child, itemState)
7474
}
7575
}
7676

77-
fragment.appendChild(cloned);
78-
});
77+
fragment.appendChild(cloned)
78+
})
7979

8080
// 6. Replace <template> with generated DOM
8181
// MutationObserver will activate and process new nodes.
82-
this.replaceWith(fragment);
82+
this.replaceWith(fragment)
8383
}
8484
}
8585

86-
customElements.define("e-for-each", EForEachTemplate, { extends: "template" });
86+
customElements.define('e-for-each', EForEachTemplate, { extends: 'template' })

src/E/e-form-array.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
export default class EFormArray extends HTMLElement {
22
constructor () {
3-
super();
4-
this.ehtmlActivated = false;
3+
super()
4+
this.ehtmlActivated = false
55
}
66

77
connectedCallback () {
8-
this.addEventListener("ehtml:activated", this.onEHTMLActivated, { once: true });
8+
this.addEventListener('ehtml:activated', this.onEHTMLActivated, { once: true })
99
}
1010

1111
onEHTMLActivated () {
1212
if (this.ehtmlActivated) {
13-
return;
13+
return
1414
}
15-
this.ehtmlActivated = true;
16-
this.run();
15+
this.ehtmlActivated = true
16+
this.run()
1717
}
1818

1919
run () {
20-
const name = this.getAttribute("name");
20+
const name = this.getAttribute('name')
2121
if (name) {
22-
this.name = name;
22+
this.name = name
2323
}
2424
}
2525
}
2626

27-
customElements.define("e-form-array", EFormArray);
27+
customElements.define('e-form-array', EFormArray)

src/E/e-form-dynamic-value.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
import getNodeScopedState from "#ehtml/getNodeScopedState.js?v=41ab2bfa";
2-
import evaluatedStringWithParamsFromState from "#ehtml/evaluatedStringWithParamsFromState.js?v=01fa3e7e";
1+
import getNodeScopedState from '#ehtml/getNodeScopedState.js?v=41ab2bfa'
2+
import evaluatedStringWithParamsFromState from '#ehtml/evaluatedStringWithParamsFromState.js?v=01fa3e7e'
33

44
export default class EFormDynamicValue extends HTMLElement {
55
constructor () {
6-
super();
7-
this.ehtmlActivated = false;
6+
super()
7+
this.ehtmlActivated = false
88
}
99

1010
connectedCallback () {
11-
this.addEventListener("ehtml:activated", this.onEHTMLActivated, { once: true });
11+
this.addEventListener('ehtml:activated', this.onEHTMLActivated, { once: true })
1212
}
1313

1414
onEHTMLActivated () {
1515
if (this.ehtmlActivated) {
16-
return;
16+
return
1717
}
18-
this.ehtmlActivated = true;
19-
this.run();
18+
this.ehtmlActivated = true
19+
this.run()
2020
}
2121

2222
run () {
23-
this.style.display = "none";
24-
this.name = this.getAttribute("name");
25-
const state = getNodeScopedState(this);
23+
this.style.display = 'none'
24+
this.name = this.getAttribute('name')
25+
const state = getNodeScopedState(this)
2626
this.value = () => {
2727
return evaluatedStringWithParamsFromState(
28-
this.getAttribute("data-bound-to"),
28+
this.getAttribute('data-bound-to'),
2929
state,
3030
this
31-
);
32-
};
31+
)
32+
}
3333
}
3434
}
3535

36-
customElements.define("e-form-dynamic-value", EFormDynamicValue);
36+
customElements.define('e-form-dynamic-value', EFormDynamicValue)

src/E/e-form-object.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
export default class EFormObject extends HTMLElement {
22
constructor () {
3-
super();
4-
this.ehtmlActivated = false;
3+
super()
4+
this.ehtmlActivated = false
55
}
66

77
connectedCallback () {
8-
this.addEventListener("ehtml:activated", this.onEHTMLActivated, { once: true });
8+
this.addEventListener('ehtml:activated', this.onEHTMLActivated, { once: true })
99
}
1010

1111
onEHTMLActivated () {
1212
if (this.ehtmlActivated) {
13-
return;
13+
return
1414
}
15-
this.ehtmlActivated = true;
16-
this.run();
15+
this.ehtmlActivated = true
16+
this.run()
1717
}
1818

1919
run () {
20-
const name = this.getAttribute("name");
20+
const name = this.getAttribute('name')
2121
if (name) {
22-
this.name = name;
22+
this.name = name
2323
}
2424
}
2525
}
2626

27-
customElements.define("e-form-object", EFormObject);
27+
customElements.define('e-form-object', EFormObject)

0 commit comments

Comments
 (0)