Skip to content

Commit 0516131

Browse files
authored
Merge pull request #18 from github/eslint-plugin-custom-elements
Install `eslint-plugin-custom-elements`
2 parents b3a7810 + f628121 commit 0516131

File tree

11 files changed

+5385
-764
lines changed

11 files changed

+5385
-764
lines changed

.eslintrc.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
2+
"root": true,
3+
"plugins": ["custom-elements"],
24
"globals": {
35
"TaskListsElement": "readonly"
46
},
57
"extends": [
68
"plugin:github/recommended",
79
"plugin:github/browser",
8-
"plugin:github/typescript"
9-
]
10+
"plugin:github/typescript",
11+
"plugin:custom-elements/recommended"
12+
],
13+
"rules": {
14+
"custom-elements/tag-name-matches-class": ["error", {"suffix": "Element"}]
15+
}
1016
}

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ jobs:
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v2
9-
- name: Use Node.js 12.x
9+
- name: Use Node.js 14.x
1010
uses: actions/setup-node@v1
1111
with:
12-
node-version: 12.x
12+
node-version: 14.x
1313
- name: npm install, build, and test
1414
run: |
1515
npm install

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import '@github/task-lists-element'
2121
With a script tag:
2222

2323
```html
24-
<script type="module" src="./node_modules/@github/task-lists-element/dist/index.js">
24+
<script type="module" src="./node_modules/@github/task-lists-element/dist/task-lists-element.js">
2525
```
2626
2727
### Markup

examples/index.html

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<!-- <script type="module" src="../dist/index.js"></script> -->
6-
<script type="module" src="https://unpkg.com/@github/task-lists-element@latest"></script>
7-
<title>task-lists-element demo</title>
8-
</head>
9-
<body>
10-
<task-lists sortable>
11-
<ul class="contains-task-list">
12-
<li class="task-list-item">
13-
<label>
14-
<input type="checkbox" class="task-list-item-checkbox">
15-
Hubot
16-
</label>
17-
</li>
18-
<li class="task-list-item">
19-
<label>
20-
<input type="checkbox" class="task-list-item-checkbox">
21-
Bender
22-
</label>
23-
</li>
24-
</ul>
3+
<head>
4+
<meta charset="utf-8" />
5+
<!-- <script type="module" src="../dist/task-lists-element.js"></script> -->
6+
<script type="module" src="https://unpkg.com/@github/task-lists-element@latest"></script>
7+
<title>task-lists-element demo</title>
8+
</head>
9+
<body>
10+
<task-lists sortable>
11+
<ul class="contains-task-list">
12+
<li class="task-list-item">
13+
<label>
14+
<input type="checkbox" class="task-list-item-checkbox" />
15+
Hubot
16+
</label>
17+
</li>
18+
<li class="task-list-item">
19+
<label>
20+
<input type="checkbox" class="task-list-item-checkbox" />
21+
Bender
22+
</label>
23+
</li>
24+
</ul>
2525

26-
<ul>
27-
<li>
28-
Nested
26+
<ul>
27+
<li>
28+
Nested
2929

30-
<ul class="contains-task-list">
31-
<li class="task-list-item">
32-
<label>
33-
<input type="checkbox" class="task-list-item-checkbox">
34-
WALL-E
35-
</label>
36-
</li>
37-
<li class="task-list-item">
38-
<label>
39-
<input type="checkbox" class="task-list-item-checkbox">
40-
R2-D2
41-
</label>
30+
<ul class="contains-task-list">
31+
<li class="task-list-item">
32+
<label>
33+
<input type="checkbox" class="task-list-item-checkbox" />
34+
WALL-E
35+
</label>
36+
</li>
37+
<li class="task-list-item">
38+
<label>
39+
<input type="checkbox" class="task-list-item-checkbox" />
40+
R2-D2
41+
</label>
4242

43-
<ul class="contains-task-list">
44-
<li class="task-list-item">
45-
<label>
46-
<input type="checkbox" class="task-list-item-checkbox">
47-
Baymax
48-
</label>
49-
</li>
50-
</ul>
51-
</li>
52-
<li class="task-list-item">
53-
<label>
54-
<input type="checkbox" class="task-list-item-checkbox">
55-
BB-8
56-
</label>
57-
</li>
58-
</ul>
59-
</li>
60-
</ul>
61-
</task-lists>
62-
<pre class="events"></pre>
63-
<script type="text/javascript">
64-
const events = document.querySelector('.events')
65-
document.addEventListener('task-lists-check', function(event) {
66-
events.append(`task-lists-check - checked: ${event.detail.checked}, position: ${event.detail.position}\n`)
67-
})
43+
<ul class="contains-task-list">
44+
<li class="task-list-item">
45+
<label>
46+
<input type="checkbox" class="task-list-item-checkbox" />
47+
Baymax
48+
</label>
49+
</li>
50+
</ul>
51+
</li>
52+
<li class="task-list-item">
53+
<label>
54+
<input type="checkbox" class="task-list-item-checkbox" />
55+
BB-8
56+
</label>
57+
</li>
58+
</ul>
59+
</li>
60+
</ul>
61+
</task-lists>
62+
<pre class="events"></pre>
63+
<script type="text/javascript">
64+
const events = document.querySelector('.events')
65+
document.addEventListener('task-lists-check', function (event) {
66+
events.append(`task-lists-check - checked: ${event.detail.checked}, position: ${event.detail.position}\n`)
67+
})
6868

69-
document.addEventListener('task-lists-move', function(event) {
70-
events.append(`task-lists-move - from: ${event.detail.src}, to: ${event.detail.dst}\n`)
71-
})
72-
</script>
73-
</body>
69+
document.addEventListener('task-lists-move', function (event) {
70+
events.append(`task-lists-move - from: ${event.detail.src}, to: ${event.detail.dst}\n`)
71+
})
72+
</script>
73+
</body>
7474
</html>

0 commit comments

Comments
 (0)