Skip to content

Commit acad11f

Browse files
authored
Update test script (#134)
* Update test script * update
1 parent 0f6348e commit acad11f

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

Diff for: .github/workflows/CI.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: Test
3030
strategy:
3131
matrix:
32-
eslint: [7, '8.0.0-0']
32+
eslint: [7, 8]
3333
node: [14, 16]
3434
os: [ubuntu-latest]
3535
include:

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
"codecov": "^3.1.0",
4141
"cross-spawn": "^6.0.5",
4242
"dts-bundle": "^0.7.3",
43-
"eslint": "^8.0.0-0",
43+
"eslint": "^8.0.0",
4444
"eslint-plugin-eslint-comments": "^3.2.0",
4545
"eslint-plugin-jsonc": "^1.4.0",
4646
"eslint-plugin-node": "^11.1.0",

Diff for: scripts/ci-install-eslint.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function sh(command) {
3434
// Install ESLint submodule of the requested version
3535
const installedVersion = require("eslint/package.json").version
3636
cd("test/fixtures/eslint")
37-
if (!installedVersion.startsWith("7.")) {
37+
if (!installedVersion.startsWith("8.")) {
3838
await sh(`git checkout v${installedVersion}`)
3939
}
4040
if (installedVersion.startsWith("5.")) {

Diff for: scripts/update-fixtures-ast.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function getTree(source, ast) {
8686
type: node.type,
8787
text: source.slice(node.range[0], node.range[1]),
8888
children: [],
89-
})
89+
}),
9090
)
9191
},
9292
leaveNode() {
@@ -127,7 +127,7 @@ function scopeToJSON(scopeManager) {
127127
reference.resolved &&
128128
reference.resolved.defs &&
129129
reference.resolved.defs[0] &&
130-
reference.resolved.defs[0].name
130+
reference.resolved.defs[0].name,
131131
),
132132
init: reference.init || null,
133133
}
@@ -225,17 +225,18 @@ for (const name of TARGETS) {
225225
const scopePath = path.join(ROOT, `${name}/scope.json`)
226226
const servicesPath = path.join(ROOT, `${name}/services.json`)
227227
const source = fs.readFileSync(sourcePath, "utf8")
228+
const parserOptions = fs.existsSync(optionsPath)
229+
? JSON.parse(fs.readFileSync(optionsPath, "utf8"))
230+
: {}
228231
const options = Object.assign(
229232
{ filePath: sourcePath },
230233
PARSER_OPTIONS,
231-
fs.existsSync(optionsPath)
232-
? JSON.parse(fs.readFileSync(optionsPath, "utf8"))
233-
: {}
234+
parserOptions,
234235
)
235236
// console.log("Start:", name)
236237
const actual = parser.parseForESLint(source, options)
237238
const tokenRanges = getAllTokens(actual.ast).map((t) =>
238-
source.slice(t.range[0], t.range[1])
239+
source.slice(t.range[0], t.range[1]),
239240
)
240241
const tree = getTree(source, actual.ast)
241242

@@ -247,13 +248,13 @@ for (const name of TARGETS) {
247248
if (fs.existsSync(scopePath)) {
248249
fs.writeFileSync(
249250
scopePath,
250-
scopeToJSON(actual.scopeManager || analyze(actual.ast, options))
251+
scopeToJSON(actual.scopeManager || analyze(actual.ast, options)),
251252
)
252253
}
253254
if (fs.existsSync(servicesPath)) {
254255
fs.writeFileSync(
255256
servicesPath,
256-
JSON.stringify(Object.keys(actual.services).sort(), null, 4)
257+
JSON.stringify(Object.keys(actual.services).sort(), null, 4),
257258
)
258259
}
259260
}

Diff for: test/fixtures/eslint

Submodule eslint updated 896 files

0 commit comments

Comments
 (0)