Skip to content

Commit 3048beb

Browse files
authored
Merge pull request #22 from github/eslint-plugin-custom-elements
Enabled `eslint-plugin-custom-elements`
2 parents 1c7170a + 1965656 commit 3048beb

File tree

7 files changed

+48
-19
lines changed

7 files changed

+48
-19
lines changed

.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
{
22
"root": true,
3+
"plugins": ["custom-elements"],
34
"extends": [
45
"plugin:github/recommended",
56
"plugin:github/browser",
6-
"plugin:github/typescript"
7+
"plugin:github/typescript",
8+
"plugin:custom-elements/recommended"
79
],
10+
"rules": {
11+
"custom-elements/file-name-matches-element": ["error", {"suffix": "Element"}],
12+
"custom-elements/tag-name-matches-class": ["error", {"suffix": "Element"}]
13+
},
814
"globals": {
915
"CustomElementElement": "readonly"
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: macos-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

examples/index.html

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
<!doctype html>
1+
<!DOCTYPE html>
22
<html lang="en">
3-
<head>
4-
<meta charset="utf-8">
5-
<title>custom-element demo</title>
6-
</head>
7-
<body>
8-
<custom-element></custom-element>
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>custom-element demo</title>
6+
</head>
7+
<body>
8+
<custom-element></custom-element>
99

10-
<script type="module">
11-
// import 'https://unpkg.com/@github/custom-element-boilerplate@latest/dist/index.js'
12-
import '../dist/index.js'
13-
</script>
14-
</body>
10+
<script type="module">
11+
// import 'https://unpkg.com/@github/custom-element-boilerplate@latest/dist/custom-element.js'
12+
import '../dist/custom-element.js'
13+
</script>
14+
</body>
1515
</html>

karma.config.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = function(config) {
22
config.set({
33
frameworks: ['mocha', 'chai'],
44
files: [
5-
{pattern: 'dist/index.js', type: 'module'},
5+
{pattern: 'dist/custom-element.js', type: 'module'},
66
{pattern: 'test/test.js', type: 'module'}
77
],
88
reporters: ['mocha'],

package-lock.json

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"name": "@github/custom-element-element",
33
"version": "0.0.1",
44
"description": "Boilerplate for creating a custom element.",
5-
"main": "dist/index.js",
6-
"module": "dist/index.js",
5+
"main": "dist/custom-element.js",
6+
"module": "dist/custom-element.js",
77
"type": "module",
8-
"types": "dist/index.d.ts",
8+
"types": "dist/custom-elements.d.ts",
99
"license": "MIT",
1010
"repository": "github/custom-element-boilerplate",
1111
"files": [
@@ -26,6 +26,7 @@
2626
"@github/prettier-config": "0.0.4",
2727
"chai": "^4.3.4",
2828
"eslint": "^7.25.0",
29+
"eslint-plugin-custom-elements": "^0.0.2",
2930
"eslint-plugin-github": "^4.1.3",
3031
"karma": "^6.3.2",
3132
"karma-chai": "^0.1.0",
File renamed without changes.

0 commit comments

Comments
 (0)