diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 072b785f..545a0cc4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,7 +29,7 @@ jobs: name: Test strategy: matrix: - eslint: [7, '8.0.0-0'] + eslint: [7, 8] node: [14, 16] os: [ubuntu-latest] include: diff --git a/package.json b/package.json index 2da4e5e2..47e0b354 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "codecov": "^3.1.0", "cross-spawn": "^6.0.5", "dts-bundle": "^0.7.3", - "eslint": "^8.0.0-0", + "eslint": "^8.0.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-jsonc": "^1.4.0", "eslint-plugin-node": "^11.1.0", diff --git a/scripts/ci-install-eslint.js b/scripts/ci-install-eslint.js index 724c0ebc..11905a72 100644 --- a/scripts/ci-install-eslint.js +++ b/scripts/ci-install-eslint.js @@ -34,7 +34,7 @@ function sh(command) { // Install ESLint submodule of the requested version const installedVersion = require("eslint/package.json").version cd("test/fixtures/eslint") - if (!installedVersion.startsWith("7.")) { + if (!installedVersion.startsWith("8.")) { await sh(`git checkout v${installedVersion}`) } if (installedVersion.startsWith("5.")) { diff --git a/scripts/update-fixtures-ast.js b/scripts/update-fixtures-ast.js index 4e67c62d..241c2c36 100644 --- a/scripts/update-fixtures-ast.js +++ b/scripts/update-fixtures-ast.js @@ -86,7 +86,7 @@ function getTree(source, ast) { type: node.type, text: source.slice(node.range[0], node.range[1]), children: [], - }) + }), ) }, leaveNode() { @@ -127,7 +127,7 @@ function scopeToJSON(scopeManager) { reference.resolved && reference.resolved.defs && reference.resolved.defs[0] && - reference.resolved.defs[0].name + reference.resolved.defs[0].name, ), init: reference.init || null, } @@ -225,17 +225,18 @@ for (const name of TARGETS) { const scopePath = path.join(ROOT, `${name}/scope.json`) const servicesPath = path.join(ROOT, `${name}/services.json`) const source = fs.readFileSync(sourcePath, "utf8") + const parserOptions = fs.existsSync(optionsPath) + ? JSON.parse(fs.readFileSync(optionsPath, "utf8")) + : {} const options = Object.assign( { filePath: sourcePath }, PARSER_OPTIONS, - fs.existsSync(optionsPath) - ? JSON.parse(fs.readFileSync(optionsPath, "utf8")) - : {} + parserOptions, ) // console.log("Start:", name) const actual = parser.parseForESLint(source, options) const tokenRanges = getAllTokens(actual.ast).map((t) => - source.slice(t.range[0], t.range[1]) + source.slice(t.range[0], t.range[1]), ) const tree = getTree(source, actual.ast) @@ -247,13 +248,13 @@ for (const name of TARGETS) { if (fs.existsSync(scopePath)) { fs.writeFileSync( scopePath, - scopeToJSON(actual.scopeManager || analyze(actual.ast, options)) + scopeToJSON(actual.scopeManager || analyze(actual.ast, options)), ) } if (fs.existsSync(servicesPath)) { fs.writeFileSync( servicesPath, - JSON.stringify(Object.keys(actual.services).sort(), null, 4) + JSON.stringify(Object.keys(actual.services).sort(), null, 4), ) } } diff --git a/test/fixtures/eslint b/test/fixtures/eslint index f44a6b4f..2774043e 160000 --- a/test/fixtures/eslint +++ b/test/fixtures/eslint @@ -1 +1 @@ -Subproject commit f44a6b4fd92602af8e2c75d5852f796ec064aa8e +Subproject commit 2774043e6bc0b5709df02ac6bb61be6ac950f77d