Skip to content

Commit 44cec62

Browse files
hildjjaladdin-add
authored andcommitted
fix: Update all dependencies. Fix a few tests where eslint now reports nodeType: null.
chore: fix eslint < v8 tests failing fix: revert minimatch to 3.1.2
1 parent 239be7d commit 44cec62

File tree

3 files changed

+57
-40
lines changed

3 files changed

+57
-40
lines changed

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,39 +16,39 @@
1616
"dependencies": {
1717
"@eslint-community/eslint-utils": "^4.4.0",
1818
"builtins": "^5.0.1",
19-
"eslint-plugin-es-x": "^6.1.0",
20-
"ignore": "^5.1.1",
21-
"is-core-module": "^2.12.0",
19+
"eslint-plugin-es-x": "^7.1.0",
20+
"ignore": "^5.2.4",
21+
"is-core-module": "^2.12.1",
2222
"minimatch": "^3.1.2",
2323
"resolve": "^1.22.2",
24-
"semver": "^7.5.0"
24+
"semver": "^7.5.3"
2525
},
2626
"devDependencies": {
27-
"@eslint/eslintrc": "^2.0.2",
28-
"@eslint/js": "^8.38.0",
29-
"@typescript-eslint/parser": "^5.59.0",
30-
"codecov": "^3.3.0",
31-
"esbuild": "^0.17.17",
32-
"eslint": "^8.38.0",
27+
"@eslint/eslintrc": "^2.0.3",
28+
"@eslint/js": "^8.43.0",
29+
"@typescript-eslint/parser": "^5.60.0",
30+
"codecov": "^3.8.2",
31+
"esbuild": "^0.18.7",
32+
"eslint": "^8.43.0",
3333
"eslint-config-prettier": "^8.8.0",
3434
"eslint-doc-generator": "^1.4.3",
35-
"eslint-plugin-eslint-plugin": "^5.0.8",
35+
"eslint-plugin-eslint-plugin": "^5.1.0",
3636
"eslint-plugin-n": "file:.",
3737
"fast-glob": "^3.2.12",
3838
"globals": "^13.20.0",
39-
"husky": "^8.0.2",
40-
"import-meta-resolve": "^2.2.2",
41-
"lint-staged": "^13.2.1",
42-
"markdownlint-cli": "^0.33.0",
43-
"mocha": "^10.1.0",
39+
"husky": "^8.0.3",
40+
"import-meta-resolve": "^3.0.0",
41+
"lint-staged": "^13.2.2",
42+
"markdownlint-cli": "^0.35.0",
43+
"mocha": "^10.2.0",
4444
"npm-run-all": "^4.1.5",
4545
"nyc": "^15.1.0",
46-
"opener": "^1.5.1",
47-
"prettier": "^2.8.7",
46+
"opener": "^1.5.2",
47+
"prettier": "^2.8.8",
4848
"punycode": "^2.3.0",
49-
"release-it": "^15.10.1",
50-
"rimraf": "^5.0.0",
51-
"typescript": "^5.0.4"
49+
"release-it": "^15.11.0",
50+
"rimraf": "^5.0.1",
51+
"typescript": "^5.1.3"
5252
},
5353
"scripts": {
5454
"build": "node scripts/update",

tests/helpers.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/**
2+
* @fileoverview Helpers for tests.
3+
* @author 唯然<weiran.zsd@outlook.com>
4+
*/
5+
"use strict"
6+
7+
const eslintVersion = require("eslint/package.json").version
8+
9+
// greater than or equal to ESLint v8
10+
exports.gtEslintV8 = +eslintVersion.split(".")[0] >= 8

tests/lib/configs/recommended.js

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
const assert = require("assert")
44
const path = require("path")
55
const { ESLint } = require("eslint")
6+
const { gtEslintV8 } = require("../../helpers")
7+
68
const originalCwd = process.cwd()
79

810
describe("node/recommended config", () => {
9-
describe("in CJS directory", () => {
11+
;(gtEslintV8 ? describe : describe.skip)("in CJS directory", () => {
1012
const root = path.resolve(__dirname, "../../fixtures/configs/cjs/")
1113

1214
/** @type {Linter} */
@@ -37,6 +39,7 @@ describe("node/recommended config", () => {
3739
message:
3840
"Parsing error: 'import' and 'export' may appear only with 'sourceType: module'",
3941
ruleId: null,
42+
nodeType: null,
4043
severity: 2,
4144
},
4245
])
@@ -55,6 +58,7 @@ describe("node/recommended config", () => {
5558
message:
5659
"Parsing error: 'import' and 'export' may appear only with 'sourceType: module'",
5760
ruleId: null,
61+
nodeType: null,
5862
severity: 2,
5963
},
6064
])
@@ -118,24 +122,27 @@ describe("node/recommended config", () => {
118122
},
119123
])
120124
})
121-
122-
it("*.cjs files should be a script.", async () => {
123-
const report = await linter.lintText("import 'foo'", {
124-
filePath: path.join(root, "test.cjs"),
125-
})
126-
127-
assert.deepStrictEqual(report[0].messages, [
128-
{
129-
column: 1,
130-
fatal: true,
131-
line: 1,
132-
message:
133-
"Parsing error: 'import' and 'export' may appear only with 'sourceType: module'",
134-
ruleId: null,
135-
severity: 2,
136-
},
137-
])
138-
})
125+
;(gtEslintV8 ? it : it.skip)(
126+
"*.cjs files should be a script.",
127+
async () => {
128+
const report = await linter.lintText("import 'foo'", {
129+
filePath: path.join(root, "test.cjs"),
130+
})
131+
132+
assert.deepStrictEqual(report[0].messages, [
133+
{
134+
column: 1,
135+
fatal: true,
136+
line: 1,
137+
message:
138+
"Parsing error: 'import' and 'export' may appear only with 'sourceType: module'",
139+
ruleId: null,
140+
nodeType: null,
141+
severity: 2,
142+
},
143+
])
144+
}
145+
)
139146

140147
it("*.mjs files should be a module.", async () => {
141148
const report = await linter.lintText("import 'foo'", {

0 commit comments

Comments
 (0)