From c3f02bfaa4264f6529fa976ef018acba2acf5c65 Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Wed, 31 Jul 2019 17:38:20 +0900 Subject: [PATCH] Upgrade dependencies --- .travis.yml | 23 +++++++++++++++++++---- package.json | 14 +++++++------- src/html/parser.ts | 1 + src/parser-services.ts | 1 + src/script/index.ts | 7 +++++-- src/script/scope-analyzer.ts | 4 ++-- 6 files changed, 35 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index e80c880e..d1f6ef72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,25 @@ sudo: false language: node_js -node_js: - - "6.5" - - "8" - - "10" +matrix: + include: + - node_js: "6.5" + env: ESLINT=5 + - node_js: "8" + env: ESLINT=5 + - node_js: "8" + env: ESLINT=6 + - node_js: "10" + env: ESLINT=5 + - node_js: "10" + env: ESLINT=6 + - node_js: "11" + +before_install: + - if [ "$ESLINT" = "6" ]; then npm i -D eslint@6.0.0; fi + - if [ "$ESLINT" = "6" ]; then npm i -S espree@6.0.0 eslint-scope@5.0.0; fi + - if [ "$ESLINT" = "5" ]; then npm i -D eslint@5.16.0 @mysticatea/eslint-plugin@9.0.1; fi + - if [ "$ESLINT" = "5" ]; then npm i -S espree@5.0.0 eslint-scope@4.0.0; fi before_script: - npm run setup diff --git a/package.json b/package.json index 3349a0ad..2bebf30c 100644 --- a/package.json +++ b/package.json @@ -10,18 +10,18 @@ "index.*" ], "peerDependencies": { - "eslint": "^5.0.0" + "eslint": "^5.0.0 || ^6.0.0" }, "dependencies": { "debug": "^4.1.1", - "eslint-scope": "^4.0.0", + "eslint-scope": "^4.0.0 || ^5.0.0", "eslint-visitor-keys": "^1.0.0", - "espree": "^5.0.0", + "espree": "^5.0.0 || ^6.0.0", "esquery": "^1.0.1", - "lodash": "^4.17.11" + "lodash": "^4.17.15" }, "devDependencies": { - "@mysticatea/eslint-plugin": "^9.0.1", + "@mysticatea/eslint-plugin": "^11.0.0", "@types/debug": "0.0.30", "@types/estree": "0.0.38", "@types/lodash": "^4.14.120", @@ -33,7 +33,7 @@ "codecov": "^3.1.0", "cross-spawn": "^6.0.5", "dts-bundle": "^0.7.3", - "eslint": "^5.13.0", + "eslint": "^6.1.0", "fs-extra": "^7.0.1", "mocha": "^6.1.4", "npm-run-all": "^4.1.5", @@ -54,7 +54,7 @@ "clean": "rimraf .nyc_output .temp coverage index.*", "codecov": "codecov", "coverage": "opener ./coverage/lcov-report/index.html", - "lint": "eslint src test --ext .js,.ts", + "lint": "node -e \"if(process.env.ESLINT=='5')process.exit(1)\" && eslint src test --ext .js,.ts || node -e \"if(process.env.ESLINT!='5')process.exit(1)\"", "setup": "git submodule update --init && cd test/fixtures/eslint && npm install", "pretest": "run-s build lint", "test": "nyc mocha \"test/*.js\" --reporter dot --timeout 10000", diff --git a/src/html/parser.ts b/src/html/parser.ts index c4f38c20..7db37671 100644 --- a/src/html/parser.ts +++ b/src/html/parser.ts @@ -194,6 +194,7 @@ export class Parser { /** * The current flag of expression enabled. */ + // eslint-disable-next-line @mysticatea/ts/ban-ts-ignore // @ts-ignore private get expressionEnabled(): boolean { return this.tokenizer.expressionEnabled diff --git a/src/parser-services.ts b/src/parser-services.ts index cdc214dd..5cf4144d 100644 --- a/src/parser-services.ts +++ b/src/parser-services.ts @@ -83,6 +83,7 @@ export function define(rootAST: ESLintProgram): ParserServices { generator, ) } finally { + // eslint-disable-next-line @mysticatea/ts/ban-ts-ignore // @ts-ignore scriptVisitor["Program:exit"] = programExitHandler emitters.delete(rootAST) diff --git a/src/script/index.ts b/src/script/index.ts index d5fa1292..c5d9e2f8 100644 --- a/src/script/index.ts +++ b/src/script/index.ts @@ -566,9 +566,12 @@ export function parseScript( ): ESLintExtendedProgram { const parser: ESLintCustomParser = typeof parserOptions.parser === "string" - ? require(parserOptions.parser) - : require("espree") + ? // eslint-disable-next-line @mysticatea/ts/no-require-imports + require(parserOptions.parser) + : // eslint-disable-next-line @mysticatea/ts/no-require-imports + require("espree") const result: any = + // eslint-disable-next-line @mysticatea/ts/unbound-method typeof parser.parseForESLint === "function" ? parser.parseForESLint(code, parserOptions) : parser.parse(code, parserOptions) diff --git a/src/script/scope-analyzer.ts b/src/script/scope-analyzer.ts index d2794945..f05f1f5a 100644 --- a/src/script/scope-analyzer.ts +++ b/src/script/scope-analyzer.ts @@ -48,8 +48,8 @@ function transformReference(reference: escopeTypes.Reference): Reference { mode: reference.isReadOnly() ? "r" : reference.isWriteOnly() - ? "w" - : /* otherwise */ "rw", + ? "w" + : /* otherwise */ "rw", variable: null, } Object.defineProperty(ret, "variable", { enumerable: false })