From 821b331a790dd888671ca262bf1c4d8850f3abf1 Mon Sep 17 00:00:00 2001 From: Milos Djermanovic Date: Mon, 10 Jun 2024 16:47:20 +0200 Subject: [PATCH] chore: switch to eslint-config-eslint v11 (#607) --- eslint.config.js | 2 ++ package.json | 4 ++-- tests/lib/acorn-after-espree.js | 2 +- tests/lib/commonjs.cjs | 2 +- tests/lib/ecma-features.js | 6 +++--- tests/lib/ecma-version.js | 8 ++++---- tests/lib/libraries.js | 8 ++++---- tests/lib/options.js | 2 +- tests/lib/parse.js | 4 ++-- tests/lib/supported-ecmaversions.js | 2 +- tests/lib/syntax.js | 2 +- tests/lib/tester-test.js | 2 +- tests/lib/tester.js | 2 +- tests/lib/tokenize.js | 2 +- tools/create-test.js | 4 ++-- tools/update-ecma-version-tests.js | 6 +++--- tools/update-tests.js | 4 ++-- tools/update-version.js | 2 +- 18 files changed, 33 insertions(+), 31 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 767d028b..e2f54c5d 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,4 +1,5 @@ import eslintConfigESLint from "eslint-config-eslint"; +import eslintConfigESLintFormatting from "eslint-config-eslint/formatting"; import globals from "globals"; export default [ @@ -11,6 +12,7 @@ export default [ ] }, ...eslintConfigESLint, + eslintConfigESLintFormatting, { files: ["tests/lib/**"], languageOptions: { diff --git a/package.json b/package.json index c8991cbb..9eae90be 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "@rollup/plugin-node-resolve": "^11.2.0", "c8": "^7.11.0", "chai": "^4.3.6", - "eslint": "^9.1.1", - "eslint-config-eslint": "^10.0.0", + "eslint": "^9.4.0", + "eslint-config-eslint": "^11.0.0", "eslint-release": "^3.2.0", "esprima-fb": "^8001.2001.0-dev-harmony-fb", "globals": "^15.1.0", diff --git a/tests/lib/acorn-after-espree.js b/tests/lib/acorn-after-espree.js index 7aee31f4..9ec10b24 100644 --- a/tests/lib/acorn-after-espree.js +++ b/tests/lib/acorn-after-espree.js @@ -8,7 +8,7 @@ //------------------------------------------------------------------------------ import * as acorn from "acorn"; -import assert from "assert"; +import assert from "node:assert"; //------------------------------------------------------------------------------ diff --git a/tests/lib/commonjs.cjs b/tests/lib/commonjs.cjs index ce892980..42e6560a 100644 --- a/tests/lib/commonjs.cjs +++ b/tests/lib/commonjs.cjs @@ -9,7 +9,7 @@ // Requirements //------------------------------------------------------------------------------ -const assert = require("assert"); +const assert = require("node:assert"); const espree = require("../../dist/espree.cjs"); diff --git a/tests/lib/ecma-features.js b/tests/lib/ecma-features.js index 6c44bb2c..e46ea0e9 100644 --- a/tests/lib/ecma-features.js +++ b/tests/lib/ecma-features.js @@ -7,11 +7,11 @@ // Requirements //------------------------------------------------------------------------------ -import assert from "assert"; -import path from "path"; +import assert from "node:assert"; +import path from "node:path"; import * as espree from "../../espree.js"; import shelljs from "shelljs"; -import { fileURLToPath, pathToFileURL } from "url"; +import { fileURLToPath, pathToFileURL } from "node:url"; import tester from "./tester.js"; diff --git a/tests/lib/ecma-version.js b/tests/lib/ecma-version.js index 3f175e1d..d3ad02a4 100644 --- a/tests/lib/ecma-version.js +++ b/tests/lib/ecma-version.js @@ -7,13 +7,13 @@ // Requirements //------------------------------------------------------------------------------ -import fs from "fs"; -import path from "path"; +import fs from "node:fs"; +import path from "node:path"; import shelljs from "shelljs"; import tester from "./tester.js"; import * as espree from "../../espree.js"; -import assert from "assert"; -import { fileURLToPath, pathToFileURL } from "url"; +import assert from "node:assert"; +import { fileURLToPath, pathToFileURL } from "node:url"; // eslint-disable-next-line no-underscore-dangle -- Conventional diff --git a/tests/lib/libraries.js b/tests/lib/libraries.js index 9560cd48..13080122 100644 --- a/tests/lib/libraries.js +++ b/tests/lib/libraries.js @@ -7,13 +7,13 @@ // Requirements //------------------------------------------------------------------------------ -import path from "path"; +import path from "node:path"; import shelljs from "shelljs"; import tester from "./tester.js"; import * as espree from "../../espree.js"; -import assert from "assert"; -import { fileURLToPath } from "url"; -import { readFile } from "fs/promises"; +import assert from "node:assert"; +import { fileURLToPath } from "node:url"; +import { readFile } from "node:fs/promises"; // eslint-disable-next-line no-underscore-dangle -- Conventional const __dirname = path.dirname(fileURLToPath(import.meta.url)); diff --git a/tests/lib/options.js b/tests/lib/options.js index 9c5571fb..9a908712 100644 --- a/tests/lib/options.js +++ b/tests/lib/options.js @@ -7,7 +7,7 @@ // Requirements //------------------------------------------------------------------------------ -import assert from "assert"; +import assert from "node:assert"; import { normalizeOptions, getLatestEcmaVersion } from "../../lib/options.js"; diff --git a/tests/lib/parse.js b/tests/lib/parse.js index 8fe385f7..459da767 100644 --- a/tests/lib/parse.js +++ b/tests/lib/parse.js @@ -7,10 +7,10 @@ // Requirements //------------------------------------------------------------------------------ -import fs from "fs"; +import fs from "node:fs"; import tester from "./tester.js"; import * as espree from "../../espree.js"; -import assert from "assert"; +import assert from "node:assert"; const allPiecesJson = JSON.parse(fs.readFileSync("./tests/fixtures/parse/all-pieces.json", "utf8")); diff --git a/tests/lib/supported-ecmaversions.js b/tests/lib/supported-ecmaversions.js index 2fe632fd..5ed37f2c 100644 --- a/tests/lib/supported-ecmaversions.js +++ b/tests/lib/supported-ecmaversions.js @@ -7,7 +7,7 @@ // Requirements //------------------------------------------------------------------------------ -import assert from "assert"; +import assert from "node:assert"; import * as espree from "../../espree.js"; diff --git a/tests/lib/syntax.js b/tests/lib/syntax.js index e1d74437..5b9a7318 100644 --- a/tests/lib/syntax.js +++ b/tests/lib/syntax.js @@ -6,7 +6,7 @@ // Requirements //------------------------------------------------------------------------------ -import assert from "assert"; +import assert from "node:assert"; import * as espree from "../../espree.js"; diff --git a/tests/lib/tester-test.js b/tests/lib/tester-test.js index 42917346..1e38fecf 100644 --- a/tests/lib/tester-test.js +++ b/tests/lib/tester-test.js @@ -1,4 +1,4 @@ -import assert from "assert"; +import assert from "node:assert"; import tester from "./tester.js"; const { getRaw, getAstCode } = tester; diff --git a/tests/lib/tester.js b/tests/lib/tester.js index 81e7e86c..45b56eb5 100644 --- a/tests/lib/tester.js +++ b/tests/lib/tester.js @@ -7,7 +7,7 @@ // Requirements //------------------------------------------------------------------------------ -import assert from "assert"; +import assert from "node:assert"; import * as espree from "../../espree.js"; diff --git a/tests/lib/tokenize.js b/tests/lib/tokenize.js index 531a6d8b..c015f24a 100644 --- a/tests/lib/tokenize.js +++ b/tests/lib/tokenize.js @@ -10,7 +10,7 @@ import tester from "./tester.js"; import * as espree from "../../espree.js"; -import assert from "assert"; +import assert from "node:assert"; import letResult from "../fixtures/tokenize/let-result.tokens.js"; import constResultTokens from "../fixtures/tokenize/const-result.tokens.js"; import regexpUResultTokens from "../fixtures/tokenize/regexp-u-result.tokens.js"; diff --git a/tools/create-test.js b/tools/create-test.js index 1179ad8c..034b423c 100644 --- a/tools/create-test.js +++ b/tools/create-test.js @@ -16,8 +16,8 @@ import shelljs from "shelljs"; import { parse } from "../espree.js"; -import path from "path"; -import { fileURLToPath } from "url"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; //------------------------------------------------------------------------------ // Initialization diff --git a/tools/update-ecma-version-tests.js b/tools/update-ecma-version-tests.js index 21068e6c..6591cd91 100644 --- a/tools/update-ecma-version-tests.js +++ b/tools/update-ecma-version-tests.js @@ -13,9 +13,9 @@ // Imports //------------------------------------------------------------------------------ -import path from "path"; -import { fileURLToPath } from "url"; -import util from "util"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import util from "node:util"; import shelljs from "shelljs"; import tester from "../tests/lib/tester.js"; diff --git a/tools/update-tests.js b/tools/update-tests.js index e2792c74..48d74db5 100644 --- a/tools/update-tests.js +++ b/tools/update-tests.js @@ -14,8 +14,8 @@ import shelljs from "shelljs"; import tester from "../tests/lib/tester.js"; -import path from "path"; -import { fileURLToPath } from "url"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; //------------------------------------------------------------------------------ // Helpers diff --git a/tools/update-version.js b/tools/update-version.js index 977bcaff..f25f05e0 100644 --- a/tools/update-version.js +++ b/tools/update-version.js @@ -3,7 +3,7 @@ * @author Nicholas C. Zakas */ -import fs from "fs"; +import fs from "node:fs"; /* * IMPORTANT: This must be run *before* Rollup so the built package will have