@@ -18,6 +18,8 @@ const { assert } = require("chai"),
18
18
const { Linter } = require("../../../lib/linter");
19
19
const { FlatConfigArray } = require("../../../lib/config/flat-config-array");
20
20
21
+ const { LATEST_ECMA_VERSION } = require("../../../conf/ecma-version");
22
+
21
23
//------------------------------------------------------------------------------
22
24
// Constants
23
25
//------------------------------------------------------------------------------
@@ -5470,7 +5472,7 @@ var a = "test2";
5470
5472
assert.strictEqual(ecmaVersion, espree.latestEcmaVersion + 2009, "ecmaVersion should be 2022");
5471
5473
});
5472
5474
5473
- it("the 'next' is equal to espree.latestEcmaVersion on languageOptions with custom parser", () => {
5475
+ it("the 'next' is equal to ESLint's latest ECMA version on languageOptions with custom parser", () => {
5474
5476
let ecmaVersion = null;
5475
5477
const config = { rules: { "ecma-version": 2 }, parser: "custom-parser", parserOptions: { ecmaVersion: "next" } };
5476
5478
@@ -5483,7 +5485,7 @@ var a = "test2";
5483
5485
})
5484
5486
});
5485
5487
linter.verify("", config);
5486
- assert.strictEqual(ecmaVersion, espree.latestEcmaVersion + 2009, " ecmaVersion should be 2022" );
5488
+ assert.strictEqual(ecmaVersion, LATEST_ECMA_VERSION, ` ecmaVersion should be ${LATEST_ECMA_VERSION}` );
5487
5489
});
5488
5490
5489
5491
it("missing ecmaVersion is equal to 5 on languageOptions with custom parser", () => {
@@ -7649,7 +7651,7 @@ describe("Linter with FlatConfigArray", () => {
7649
7651
checker: {
7650
7652
create: context => ({
7651
7653
Program() {
7652
- assert.strictEqual(context.languageOptions.ecmaVersion, espree.latestEcmaVersion + 2009 );
7654
+ assert.strictEqual(context.languageOptions.ecmaVersion, LATEST_ECMA_VERSION );
7653
7655
}
7654
7656
})
7655
7657
}
@@ -7694,7 +7696,7 @@ describe("Linter with FlatConfigArray", () => {
7694
7696
checker: {
7695
7697
create: context => ({
7696
7698
Program() {
7697
- assert.strictEqual(context.languageOptions.ecmaVersion, espree.latestEcmaVersion + 2009 );
7699
+ assert.strictEqual(context.languageOptions.ecmaVersion, LATEST_ECMA_VERSION );
7698
7700
}
7699
7701
})
7700
7702
}
@@ -8359,7 +8361,7 @@ describe("Linter with FlatConfigArray", () => {
8359
8361
}, "filename.js");
8360
8362
8361
8363
assert(spy.calledWithMatch(";", {
8362
- ecmaVersion: espree.latestEcmaVersion + 2009 ,
8364
+ ecmaVersion: LATEST_ECMA_VERSION ,
8363
8365
sourceType: "module"
8364
8366
}));
8365
8367
});
0 commit comments