mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
* enable prefer-node-protocol rule * prefer node protocol import * fix broken scripts * fix e2e-old-babel error * strip node: protocol for old node versions * update Makefile.mjs
48 lines
1.4 KiB
JavaScript
48 lines
1.4 KiB
JavaScript
import { ESLint } from "eslint";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
describe("https://github.com/babel/babel/issues/12985", () => {
|
|
it(
|
|
"works with different copies of @babel/parser - ESLint " + ESLint.version,
|
|
async () => {
|
|
if (parseInt(ESLint.version, 10) >= 9) {
|
|
const engine = new ESLint({
|
|
ignore: false,
|
|
overrideConfigFile: fileURLToPath(
|
|
new URL(
|
|
"../fixtures/duplicated-babel-parser/eslint.config.cjs",
|
|
import.meta.url,
|
|
),
|
|
),
|
|
});
|
|
// eslint-disable-next-line jest/no-conditional-expect
|
|
expect(
|
|
await engine.lintFiles([
|
|
fileURLToPath(
|
|
new URL(
|
|
"../fixtures/duplicated-babel-parser/a.js",
|
|
import.meta.url,
|
|
),
|
|
),
|
|
]),
|
|
).toMatchObject([{ errorCount: 0, messages: [] }]);
|
|
} else {
|
|
const engine = new ESLint({
|
|
ignore: false,
|
|
});
|
|
// eslint-disable-next-line jest/no-conditional-expect
|
|
expect(
|
|
await engine.lintFiles([
|
|
fileURLToPath(
|
|
new URL(
|
|
"../fixtures/duplicated-babel-parser-eslint-8/a.js",
|
|
import.meta.url,
|
|
),
|
|
),
|
|
]),
|
|
).toMatchObject([{ errorCount: 0, messages: [] }]);
|
|
}
|
|
},
|
|
);
|
|
});
|