Skip to content

Commit 0dd6644

Browse files
committed
⬆️ upgrade dependencies and fix new lint errors
1 parent da877ec commit 0dd6644

File tree

8 files changed

+72
-67
lines changed

8 files changed

+72
-67
lines changed

package.json

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,41 @@
1313
"eslint": "^5.0.0"
1414
},
1515
"dependencies": {
16-
"debug": "^3.1.0",
16+
"debug": "^4.1.0",
1717
"eslint-scope": "^4.0.0",
1818
"eslint-visitor-keys": "^1.0.0",
19-
"espree": "^4.0.0",
19+
"espree": "^4.1.0",
2020
"esquery": "^1.0.1",
21-
"lodash": "^4.17.10"
21+
"lodash": "^4.17.11"
2222
},
2323
"devDependencies": {
24-
"@mysticatea/eslint-plugin": "^5.0.1",
24+
"@mysticatea/eslint-plugin": "^7.0.0",
2525
"@types/debug": "0.0.30",
2626
"@types/estree": "0.0.38",
27-
"@types/lodash": "^4.14.110",
27+
"@types/lodash": "^4.14.118",
2828
"@types/mocha": "^5.2.4",
29-
"@types/node": "^6.0.113",
30-
"babel-eslint": "^8.2.5",
29+
"@types/node": "^10.12.9",
30+
"acorn": "^6.0.4",
31+
"acorn-jsx": "^5.0.0",
32+
"babel-eslint": "^10.0.1",
3133
"chokidar": "^2.0.4",
32-
"codecov": "^3.0.2",
34+
"codecov": "^3.1.0",
3335
"cross-spawn": "^6.0.5",
3436
"dts-bundle": "^0.7.3",
35-
"eslint": "^5.0.1",
36-
"fs-extra": "^6.0.1",
37+
"eslint": "^5.9.0",
38+
"fs-extra": "^7.0.1",
3739
"mocha": "^5.2.0",
3840
"npm-run-all": "^4.1.3",
39-
"nyc": "^12.0.2",
40-
"opener": "^1.4.3",
41+
"nyc": "^13.1.0",
42+
"opener": "^1.5.1",
4143
"rimraf": "^2.6.2",
42-
"rollup": "^0.60.7",
43-
"rollup-plugin-node-resolve": "^3.3.0",
44+
"rollup": "^0.67.1",
45+
"rollup-plugin-node-resolve": "^3.4.0",
4446
"rollup-plugin-sourcemaps": "^0.4.2",
4547
"rollup-watch": "^4.3.1",
46-
"typescript": "^2.9.2",
47-
"typescript-eslint-parser": "^16.0.1",
48-
"wait-on": "^2.1.0",
48+
"typescript": "~3.1.6",
49+
"typescript-eslint-parser": "^21.0.1",
50+
"wait-on": "^3.2.0",
4951
"warun": "^1.0.0"
5052
},
5153
"scripts": {

src/html/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ import {
4747
} from "./intermediate-tokenizer"
4848
import { Tokenizer } from "./tokenizer"
4949

50-
const DIRECTIVE_NAME = /^(?:v-|[:@]).*[^.:@]$/
51-
const DT_DD = /^d[dt]$/
50+
const DIRECTIVE_NAME = /^(?:v-|[:@]).*[^.:@]$/u
51+
const DT_DD = /^d[dt]$/u
5252
const DUMMY_PARENT: any = Object.freeze({})
5353

5454
/**

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { HTMLParser, HTMLTokenizer } from "./html"
1010
import { parseScript, parseScriptElement } from "./script"
1111
import * as services from "./parser-services"
1212

13-
const STARTS_WITH_LT = /^\s*</
13+
const STARTS_WITH_LT = /^\s*</u
1414

1515
/**
1616
* Check whether the code is a Vue.js component.

src/parser-services.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ export interface ParserServices {
2626
* @param scriptVisitor The script handlers. This is optional.
2727
*/
2828
defineTemplateBodyVisitor(
29-
templateBodyVisitor: { [key: string]: Function },
30-
scriptVisitor?: { [key: string]: Function },
29+
templateBodyVisitor: { [key: string]: (...args: any) => void },
30+
scriptVisitor?: { [key: string]: (...args: any) => void },
3131
): object
3232

3333
/**
@@ -49,8 +49,8 @@ export function define(rootAST: ESLintProgram): ParserServices {
4949
* @param scriptVisitor The script handlers. This is optional.
5050
*/
5151
defineTemplateBodyVisitor(
52-
templateBodyVisitor: { [key: string]: Function },
53-
scriptVisitor?: { [key: string]: Function },
52+
templateBodyVisitor: { [key: string]: (...args: any) => void },
53+
scriptVisitor?: { [key: string]: (...args: any) => void },
5454
): object {
5555
if (scriptVisitor == null) {
5656
scriptVisitor = {} //eslint-disable-line no-param-reassign

src/script/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
// [1] = spacing before the aliases.
4141
// [2] = aliases.
4242
// [3] = all after the aliases.
43-
const ALIAS_PARENS = /^(\s*)\(([\s\S]+)\)(\s*(?:in|of)\b[\s\S]+)$/
43+
const ALIAS_PARENS = /^(\s*)\(([\s\S]+)\)(\s*(?:in|of)\b[\s\S]+)$/u
4444
const DUMMY_PARENT: any = {}
4545

4646
/**

test/ast.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ describe("Template AST", () => {
177177
})
178178

179179
it("should have correct location.", () => {
180-
const lines = source.match(/[^\r\n]*(?:\r?\n|$)/g) || []
180+
const lines = source.match(/[^\r\n]*(?:\r?\n|$)/gu) || []
181181
lines.push(String.fromCodePoint(0))
182182
for (const token of getAllTokens(actual.ast)) {
183183
const line0 = token.loc.start.line - 1

test/fixtures/eslint

Submodule eslint updated 473 files

test/index.js

Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,9 @@ describe("Basic tests", () => {
402402
const text = ast.templateBody.children[0]
403403
const errors = ast.templateBody.errors
404404

405-
assert.equal(text.value, "\u0000")
406-
assert.equal(errors.length, 1)
407-
assert.equal(errors[0].code, "unexpected-null-character")
405+
assert.strictEqual(text.value, "\u0000")
406+
assert.strictEqual(errors.length, 1)
407+
assert.strictEqual(errors[0].code, "unexpected-null-character")
408408
})
409409

410410
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in RCDATA state.", () => {
@@ -414,29 +414,29 @@ describe("Basic tests", () => {
414414
const text = ast.templateBody.children[0].children[0]
415415
const errors = ast.templateBody.errors
416416

417-
assert.equal(text.value, "\uFFFD")
418-
assert.equal(errors.length, 1)
419-
assert.equal(errors[0].code, "unexpected-null-character")
417+
assert.strictEqual(text.value, "\uFFFD")
418+
assert.strictEqual(errors.length, 1)
419+
assert.strictEqual(errors[0].code, "unexpected-null-character")
420420
})
421421

422422
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in RAWTEXT state.", () => {
423423
const ast = parse("<template><style>\u0000</style></template>")
424424
const text = ast.templateBody.children[0].children[0]
425425
const errors = ast.templateBody.errors
426426

427-
assert.equal(text.value, "\uFFFD")
428-
assert.equal(errors.length, 1)
429-
assert.equal(errors[0].code, "unexpected-null-character")
427+
assert.strictEqual(text.value, "\uFFFD")
428+
assert.strictEqual(errors.length, 1)
429+
assert.strictEqual(errors[0].code, "unexpected-null-character")
430430
})
431431

432432
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in TAG_NAME state.", () => {
433433
const ast = parse("<template><test\u0000></template>")
434434
const element = ast.templateBody.children[0]
435435
const errors = ast.templateBody.errors
436436

437-
assert.equal(element.name, "test\uFFFD")
438-
assert.equal(errors.length, 1)
439-
assert.equal(errors[0].code, "unexpected-null-character")
437+
assert.strictEqual(element.name, "test\uFFFD")
438+
assert.strictEqual(errors.length, 1)
439+
assert.strictEqual(errors[0].code, "unexpected-null-character")
440440
})
441441

442442
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_NAME state.", () => {
@@ -445,9 +445,9 @@ describe("Basic tests", () => {
445445
ast.templateBody.children[0].startTag.attributes[0]
446446
const errors = ast.templateBody.errors
447447

448-
assert.equal(attribute.key.name, "a\uFFFD")
449-
assert.equal(errors.length, 1)
450-
assert.equal(errors[0].code, "unexpected-null-character")
448+
assert.strictEqual(attribute.key.name, "a\uFFFD")
449+
assert.strictEqual(errors.length, 1)
450+
assert.strictEqual(errors[0].code, "unexpected-null-character")
451451
})
452452

453453
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_VALUE_DOUBLE_QUOTED state.", () => {
@@ -456,9 +456,9 @@ describe("Basic tests", () => {
456456
ast.templateBody.children[0].startTag.attributes[0]
457457
const errors = ast.templateBody.errors
458458

459-
assert.equal(attribute.value.value, "\uFFFD")
460-
assert.equal(errors.length, 1)
461-
assert.equal(errors[0].code, "unexpected-null-character")
459+
assert.strictEqual(attribute.value.value, "\uFFFD")
460+
assert.strictEqual(errors.length, 1)
461+
assert.strictEqual(errors[0].code, "unexpected-null-character")
462462
})
463463

464464
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_VALUE_SINGLE_QUOTED state.", () => {
@@ -467,9 +467,9 @@ describe("Basic tests", () => {
467467
ast.templateBody.children[0].startTag.attributes[0]
468468
const errors = ast.templateBody.errors
469469

470-
assert.equal(attribute.value.value, "\uFFFD")
471-
assert.equal(errors.length, 1)
472-
assert.equal(errors[0].code, "unexpected-null-character")
470+
assert.strictEqual(attribute.value.value, "\uFFFD")
471+
assert.strictEqual(errors.length, 1)
472+
assert.strictEqual(errors[0].code, "unexpected-null-character")
473473
})
474474

475475
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in ATTRIBUTE_VALUE_UNQUOTED state.", () => {
@@ -478,29 +478,29 @@ describe("Basic tests", () => {
478478
ast.templateBody.children[0].startTag.attributes[0]
479479
const errors = ast.templateBody.errors
480480

481-
assert.equal(attribute.value.value, "\uFFFD")
482-
assert.equal(errors.length, 1)
483-
assert.equal(errors[0].code, "unexpected-null-character")
481+
assert.strictEqual(attribute.value.value, "\uFFFD")
482+
assert.strictEqual(errors.length, 1)
483+
assert.strictEqual(errors[0].code, "unexpected-null-character")
484484
})
485485

486486
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in COMMENT state.", () => {
487487
const ast = parse("<template><!-- \u0000 --></template>")
488488
const comment = ast.templateBody.comments[0]
489489
const errors = ast.templateBody.errors
490490

491-
assert.equal(comment.value, " \uFFFD ")
492-
assert.equal(errors.length, 1)
493-
assert.equal(errors[0].code, "unexpected-null-character")
491+
assert.strictEqual(comment.value, " \uFFFD ")
492+
assert.strictEqual(errors.length, 1)
493+
assert.strictEqual(errors[0].code, "unexpected-null-character")
494494
})
495495

496496
it("should replace NULL by U+FFFD REPLACEMENT CHARACTER in BOGUS_COMMENT state.", () => {
497497
const ast = parse("<template><? \u0000 ?></template>")
498498
const comment = ast.templateBody.comments[0]
499499
const errors = ast.templateBody.errors
500500

501-
assert.equal(comment.value, "? \uFFFD ?")
502-
assert.equal(errors.length, 1)
503-
assert.equal(
501+
assert.strictEqual(comment.value, "? \uFFFD ?")
502+
assert.strictEqual(errors.length, 1)
503+
assert.strictEqual(
504504
errors[0].code,
505505
"unexpected-question-mark-instead-of-tag-name"
506506
)
@@ -511,21 +511,21 @@ describe("Basic tests", () => {
511511
const cdata = ast.templateBody.children[0].children[0]
512512
const errors = ast.templateBody.errors
513513

514-
assert.equal(cdata.value, "\u0000")
515-
assert.equal(errors.length, 0)
514+
assert.strictEqual(cdata.value, "\u0000")
515+
assert.strictEqual(errors.length, 0)
516516
})
517517
})
518518

519519
describe("About parserServices", () => {
520520
it("should exist if the source code is a Vue SFC file.", () => {
521-
assert.notEqual(
521+
assert.notStrictEqual(
522522
parseForESLint("test", { filePath: "test.vue" }).services,
523523
undefined
524524
)
525525
})
526526

527527
it("should exist even if the source code is not Vue SFC file.", () => {
528-
assert.notEqual(
528+
assert.notStrictEqual(
529529
parseForESLint("test", { filePath: "test.js" }).services,
530530
undefined
531531
)
@@ -549,8 +549,11 @@ describe("Basic tests", () => {
549549
eslintVisitorKeys: true,
550550
})
551551

552-
assert.equal(ast.body[2].declaration.range[0], indexOfDecorator)
553-
assert.equal(
552+
assert.strictEqual(
553+
ast.body[2].declaration.range[0],
554+
indexOfDecorator
555+
)
556+
assert.strictEqual(
554557
ast.body[2].declaration.decorators[0].range[0],
555558
indexOfDecorator
556559
)
@@ -579,10 +582,10 @@ describe("Basic tests", () => {
579582
const messages1 = linter.verify(code, config)
580583
const messages2 = linter.verify(linter.getSourceCode(), config)
581584

582-
assert.equal(messages1.length, 1)
583-
assert.equal(messages1[0].message, "OK")
584-
assert.equal(messages2.length, 1)
585-
assert.equal(messages1[0].message, "OK")
585+
assert.strictEqual(messages1.length, 1)
586+
assert.strictEqual(messages1[0].message, "OK")
587+
assert.strictEqual(messages2.length, 1)
588+
assert.strictEqual(messages1[0].message, "OK")
586589
})
587590
})
588591
})

0 commit comments

Comments
 (0)