Skip to content

Commit 93432ad

Browse files
committed
Switch to TS and exports only ESmodule
1 parent 700b300 commit 93432ad

17 files changed

+1605
-1524
lines changed

.babelrc

-16
This file was deleted.

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist
2+
prettier.config.js
3+
karma.config.js

.eslintrc.json

+16-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
{
2-
"extends": ["plugin:github/es6", "plugin:github/browser", "plugin:github/flow"],
3-
"parser": "babel-eslint"
2+
"extends": [
3+
"plugin:github/browser",
4+
"plugin:github/es6",
5+
"plugin:github/typescript"
6+
],
7+
"globals": {
8+
"Combobox": "readable"
9+
},
10+
"overrides": [
11+
{
12+
"files": "test/**/*.js",
13+
"rules": {
14+
"github/unescaped-html-literal": "off"
15+
}
16+
}
17+
]
418
}

.flowconfig

-9
This file was deleted.

examples/index.html

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
<head>
44
<meta charset="utf-8">
55
<title>combobox-nav demo</title>
6-
<!-- <script type="text/javascript" src="../dist/combobox-nav.umd.js"></script> -->
7-
<script type="text/javascript" src="https://unpkg.com/@github/combobox-nav@latest/dist/combobox-nav.umd.js"></script>
86
<style>[aria-selected="true"] { font-weight: bold; }</style>
97
</head>
108
<body>
@@ -22,25 +20,28 @@
2220
</ul>
2321
</form>
2422
<pre class="events"></pre>
25-
<script type="text/javascript">
23+
24+
<script type="module">
25+
// import {install, uninstall, stop, start} from '../dist/index.js'
26+
import {install, uninstall, stop, start} from 'https://unpkg.com/@github/combobox-nav@latest/dist/index.js'
2627
const input = document.querySelector('input')
2728
const list = document.querySelector('ul')
28-
comboboxNav.install(input, list)
29+
install(input, list)
2930

3031
function toggleList() {
3132
const hidden = input.value.length === 0
3233
if (hidden) {
33-
comboboxNav.stop(input)
34+
stop(input)
3435
} else {
35-
comboboxNav.start(input)
36+
start(input)
3637
}
3738
list.hidden = hidden
3839
}
3940
input.addEventListener('input', toggleList)
4041
input.addEventListener('focus', toggleList)
4142
input.addEventListener('blur', () => {
4243
list.hidden = true
43-
comboboxNav.stop(input)
44+
stop(input)
4445
})
4546

4647
const events = document.querySelector('.events')

index.d.ts

-4
This file was deleted.

test/karma.config.js renamed to karma.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = function(config) {
22
config.set({
33
frameworks: ['mocha', 'chai'],
4-
files: ['../dist/combobox-nav.umd.js', 'test.js'],
4+
files: [{pattern: 'dist/index.js', type: 'module'}, {pattern: 'test/test.js', type: 'module'}],
55
reporters: ['mocha'],
66
port: 9876,
77
colors: true,

0 commit comments

Comments
 (0)