Skip to content

Commit b7faae4

Browse files
committed
Update development dependencies
1 parent 0a0d7ee commit b7faae4

File tree

8 files changed

+1431
-1889
lines changed

8 files changed

+1431
-1889
lines changed

.eslintrc.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

package-lock.json

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

package.json

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"types": "dist/index.d.ts",
99
"scripts": {
1010
"clean": "rm -rf dist",
11-
"lint": "github-lint",
11+
"lint": "eslint src/*.ts test/*.js",
1212
"prebuild": "npm run clean && npm run lint && mkdir dist",
1313
"build": "rollup -c",
1414
"pretest": "npm run build",
@@ -26,18 +26,27 @@
2626
"dist/index.esm.js",
2727
"dist/index.umd.js"
2828
],
29+
"prettier": "@github/prettier-config",
2930
"devDependencies": {
31+
"@github/prettier-config": "0.0.4",
3032
"chai": "^4.2.0",
31-
"eslint": "^6.8.0",
32-
"eslint-plugin-github": "^3.4.0",
33-
"karma": "^4.4.1",
33+
"eslint": "^7.8.0",
34+
"eslint-plugin-github": "^4.1.1",
35+
"karma": "^5.2.0",
3436
"karma-chai": "^0.1.0",
3537
"karma-chrome-launcher": "^3.1.0",
36-
"karma-mocha": "^1.3.0",
38+
"karma-mocha": "^2.0.1",
3739
"karma-mocha-reporter": "^2.2.5",
38-
"mocha": "^7.0.1",
39-
"rollup": "^1.31.1",
40-
"rollup-plugin-typescript2": "^0.26.0",
41-
"typescript": "^3.7.5"
40+
"mocha": "^8.1.3",
41+
"rollup": "^2.26.9",
42+
"rollup-plugin-typescript2": "^0.27.2",
43+
"typescript": "^4.0.2"
44+
},
45+
"eslintConfig": {
46+
"extends": [
47+
"plugin:github/browser",
48+
"plugin:github/recommended",
49+
"plugin:github/typescript"
50+
]
4251
}
4352
}

src/paste-markdown-image-link.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import {insertText} from './text'
44

5-
export function install(el: HTMLElement) {
5+
export function install(el: HTMLElement): void {
66
el.addEventListener('dragover', onDragover)
77
el.addEventListener('drop', onDrop)
88
el.addEventListener('paste', onPaste)
99
}
1010

11-
export function uninstall(el: HTMLElement) {
11+
export function uninstall(el: HTMLElement): void {
1212
el.removeEventListener('dragover', onDragover)
1313
el.removeEventListener('drop', onDrop)
1414
el.removeEventListener('paste', onPaste)

src/paste-markdown-table.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import {insertText} from './text'
44

5-
export function install(el: HTMLElement) {
5+
export function install(el: HTMLElement): void {
66
el.addEventListener('dragover', onDragover)
77
el.addEventListener('drop', onDrop)
88
el.addEventListener('paste', onPaste)
99
}
1010

11-
export function uninstall(el: HTMLElement) {
11+
export function uninstall(el: HTMLElement): void {
1212
el.removeEventListener('dragover', onDragover)
1313
el.removeEventListener('drop', onDrop)
1414
el.removeEventListener('paste', onPaste)
@@ -58,10 +58,7 @@ function hasFile(transfer: DataTransfer): boolean {
5858

5959
function columnText(column: Element): string {
6060
const noBreakSpace = '\u00A0'
61-
const text = (column.textContent || '')
62-
.trim()
63-
.replace(/\|/g, '\\|')
64-
.replace(/\n/g, ' ')
61+
const text = (column.textContent || '').trim().replace(/\|/g, '\\|').replace(/\n/g, ' ')
6562
return text || noBreakSpace
6663
}
6764

@@ -80,9 +77,7 @@ function tableMarkdown(node: Element): string {
8077

8178
const body = rows
8279
.map(row => {
83-
return Array.from(row.querySelectorAll('td'))
84-
.map(columnText)
85-
.join(' | ')
80+
return Array.from(row.querySelectorAll('td')).map(columnText).join(' | ')
8681
})
8782
.join('\n')
8883

src/paste-markdown-text.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import {insertText} from './text'
22

3-
export function install(el: HTMLElement) {
3+
export function install(el: HTMLElement): void {
44
el.addEventListener('paste', onPaste)
55
}
66

7-
export function uninstall(el: HTMLElement) {
7+
export function uninstall(el: HTMLElement): void {
88
el.removeEventListener('paste', onPaste)
99
}
1010

test/.eslintrc.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
},
55
"globals": {
66
"assert": true
7-
},
8-
"extends": "../.eslintrc.json"
7+
}
98
}

test/test.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import subscribe from '../dist/index.esm.js'
22

3-
describe('paste-markdown', function() {
4-
describe('installed on textarea', function() {
3+
describe('paste-markdown', function () {
4+
describe('installed on textarea', function () {
55
let subscription, textarea
6-
beforeEach(function() {
6+
beforeEach(function () {
77
document.body.innerHTML = `
88
<textarea data-paste-markdown></textarea>
99
`
@@ -12,17 +12,17 @@ describe('paste-markdown', function() {
1212
subscription = subscribe(textarea)
1313
})
1414

15-
afterEach(function() {
15+
afterEach(function () {
1616
subscription.unsubscribe()
1717
document.body.innerHTML = ''
1818
})
1919

20-
it('turns image uris into markdown', function() {
20+
it('turns image uris into markdown', function () {
2121
paste(textarea, {'text/uri-list': 'https://github.com/github.png\r\nhttps://github.com/hubot.png'})
2222
assert.include(textarea.value, '![](https://github.com/github.png)\n\n![](https://github.com/hubot.png)')
2323
})
2424

25-
it('turns html tables into markdown', function() {
25+
it('turns html tables into markdown', function () {
2626
const data = {
2727
'text/html': `
2828
<table>
@@ -38,7 +38,7 @@ describe('paste-markdown', function() {
3838
assert.include(textarea.value, 'name | origin\n-- | --\nhubot | github\nbender | futurama')
3939
})
4040

41-
it('rejects layout tables', function() {
41+
it('rejects layout tables', function () {
4242
const data = {
4343
'text/html': `
4444
<table data-paste-markdown-skip>
@@ -54,7 +54,7 @@ describe('paste-markdown', function() {
5454
assert.equal(textarea.value, '')
5555
})
5656

57-
it('accepts x-gfm', function() {
57+
it('accepts x-gfm', function () {
5858
paste(textarea, {'text/plain': 'hello', 'text/x-gfm': '# hello'})
5959
assert.include(textarea.value, '# hello')
6060
})

0 commit comments

Comments
 (0)