Skip to content

Commit 5bc8c13

Browse files
committed
Update development dependencies
1 parent f4d57db commit 5bc8c13

7 files changed

Lines changed: 1428 additions & 2660 deletions

File tree

.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"parser": "@typescript-eslint/parser",
33
"extends": [
4-
"plugin:github/es6",
54
"plugin:github/browser",
5+
"plugin:github/recommended",
66
"plugin:github/typescript"
77
],
88
"globals": {

package-lock.json

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

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,27 @@
1212
],
1313
"scripts": {
1414
"clean": "rm -rf dist",
15-
"lint": "github-lint",
15+
"lint": "eslint src/*.ts test/*.js",
1616
"prebuild": "npm run clean && npm run lint && mkdir dist",
1717
"build": "tsc",
1818
"pretest": "npm run build",
1919
"test": "karma start test/karma.config.js",
2020
"prepublishOnly": "npm run build",
2121
"postpublish": "npm publish --ignore-scripts --@github:registry='https://npm.pkg.github.com'"
2222
},
23+
"prettier": "@github/prettier-config",
2324
"devDependencies": {
25+
"@github/prettier-config": "0.0.4",
2426
"chai": "^4.2.0",
25-
"eslint": "^6.8.0",
26-
"eslint-plugin-github": "^3.4.1",
27-
"karma": "^4.4.1",
27+
"eslint": "^7.9.0",
28+
"eslint-plugin-github": "^4.1.1",
29+
"karma": "^5.2.2",
2830
"karma-chai": "^0.1.0",
2931
"karma-chrome-launcher": "^3.1.0",
30-
"karma-mocha": "^1.3.0",
32+
"karma-mocha": "^2.0.1",
3133
"karma-mocha-reporter": "^2.2.5",
3234
"mocha": "^7.1.0",
33-
"typescript": "^3.8.3"
35+
"typescript": "^4.0.3"
3436
},
3537
"eslintIgnore": [
3638
"dist/"

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default class TabContainerElement extends HTMLElement {
3838
})
3939
}
4040

41-
connectedCallback() {
41+
connectedCallback(): void {
4242
for (const tab of this.querySelectorAll('[role="tablist"] [role="tab"]')) {
4343
if (!tab.hasAttribute('aria-selected')) {
4444
tab.setAttribute('aria-selected', 'false')

test/.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"env": {
3-
"mocha": true
3+
"mocha": true,
4+
"node": true
45
},
56
"globals": {
67
"assert": true

test/karma.config.js

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

test/test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
describe('tab-container', function() {
2-
describe('element creation', function() {
3-
it('creates from document.createElement', function() {
1+
describe('tab-container', function () {
2+
describe('element creation', function () {
3+
it('creates from document.createElement', function () {
44
const el = document.createElement('tab-container')
55
assert.equal('TAB-CONTAINER', el.nodeName)
66
})
77

8-
it('creates from constructor', function() {
8+
it('creates from constructor', function () {
99
const el = new window.TabContainerElement()
1010
assert.equal('TAB-CONTAINER', el.nodeName)
1111
})
1212
})
1313

14-
describe('after tree insertion', function() {
15-
beforeEach(function() {
14+
describe('after tree insertion', function () {
15+
beforeEach(function () {
1616
document.body.innerHTML = `
1717
<tab-container>
1818
<div role="tablist">
@@ -33,11 +33,11 @@ describe('tab-container', function() {
3333
`
3434
})
3535

36-
afterEach(function() {
36+
afterEach(function () {
3737
document.body.innerHTML = ''
3838
})
3939

40-
it('click works and `tab-container-changed` event is dispatched', function() {
40+
it('click works and `tab-container-changed` event is dispatched', function () {
4141
const tabContainer = document.querySelector('tab-container')
4242
const tabs = document.querySelectorAll('button')
4343
const panels = document.querySelectorAll('[role="tabpanel"]')
@@ -54,7 +54,7 @@ describe('tab-container', function() {
5454
assert.equal(document.activeElement, tabs[1])
5555
})
5656

57-
it('keyboard shortcuts work and `tab-container-changed` events are dispatched', function() {
57+
it('keyboard shortcuts work and `tab-container-changed` events are dispatched', function () {
5858
const tabContainer = document.querySelector('tab-container')
5959
const tabs = document.querySelectorAll('button')
6060
const panels = document.querySelectorAll('[role="tabpanel"]')
@@ -73,7 +73,7 @@ describe('tab-container', function() {
7373
assert.equal(counter, 2)
7474
})
7575

76-
it('click works and a cancellable `tab-container-change` event is dispatched', function() {
76+
it('click works and a cancellable `tab-container-change` event is dispatched', function () {
7777
const tabContainer = document.querySelector('tab-container')
7878
const tabs = document.querySelectorAll('button')
7979
const panels = document.querySelectorAll('[role="tabpanel"]')
@@ -94,7 +94,7 @@ describe('tab-container', function() {
9494
assert.equal(counter, 1)
9595
})
9696

97-
it("panels that don't have a `data-tab-container-no-tabstop` attribute have tabindex with value '0'", function() {
97+
it("panels that don't have a `data-tab-container-no-tabstop` attribute have tabindex with value '0'", function () {
9898
const tabs = document.querySelectorAll('button')
9999
const panels = document.querySelectorAll('[role="tabpanel"]')
100100

@@ -105,22 +105,22 @@ describe('tab-container', function() {
105105
assert(!panels[2].hasAttribute('tabindex'))
106106
})
107107

108-
it('the aria-selected attribute is set to "false" for all tabs that don\'t have a aria-selected attribute', function() {
108+
it('the aria-selected attribute is set to "false" for all tabs that don\'t have a aria-selected attribute', function () {
109109
for (const tab of document.querySelectorAll('[role="tab"]:not([aria-selected="true"])')) {
110110
assert.equal(tab.getAttribute('aria-selected'), 'false')
111111
}
112112
})
113113

114-
it('the tabindex attribute is set to "0" for the selected tab', function() {
114+
it('the tabindex attribute is set to "0" for the selected tab', function () {
115115
assert.equal(document.querySelector('[role="tab"][aria-selected="true"]').getAttribute('tabindex'), '0')
116116
})
117117

118-
it('the tabindex attribute is set to "-1" for the non-selected tabs', function() {
118+
it('the tabindex attribute is set to "-1" for the non-selected tabs', function () {
119119
for (const tab of document.querySelectorAll('[role="tab"]:not([aria-selected="true"])')) {
120120
assert.equal(tab.getAttribute('tabindex'), '-1')
121121
}
122122
})
123-
it('selected tab has tabindex="0" after selection', function() {
123+
it('selected tab has tabindex="0" after selection', function () {
124124
const tabs = document.querySelectorAll('[role="tab"]')
125125

126126
tabs[1].click()

0 commit comments

Comments
 (0)