Skip to content

Commit

Permalink
chore: not set default 5
Browse files Browse the repository at this point in the history
  • Loading branch information
aladdin-add committed Jun 20, 2021
1 parent 6cbab8a commit 4977ae0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
4 changes: 0 additions & 4 deletions lib/linter/linter.js
Expand Up @@ -441,10 +441,6 @@ function normalizeEcmaVersion(parser, ecmaVersion) {

// RuleTester always wraps parser, parser.$parser is the original parser object
if ((parser.$parser || parser) === espree) {
if (ecmaVersion === void 0) {
return DEFAULT_ECMA_VERSION;
}

if (ecmaVersion === "latest") {
return espree.latestEcmaVersion;
}
Expand Down
13 changes: 0 additions & 13 deletions tests/lib/linter/linter.js
Expand Up @@ -3501,19 +3501,6 @@ var a = "test2";
assert.strictEqual(messages.length, 1);
});

it("the default ECMAScript version is 5", () => {
let ecmaVersion = null;
const config = { rules: { "ecma-version": 2 } };

linter.defineRule("ecma-version", context => ({
Program() {
ecmaVersion = context.parserOptions.ecmaVersion;
}
}));
linter.verify("", config);
assert.strictEqual(ecmaVersion, 5);
});

it("supports ECMAScript version 'latest'", () => {
const messages = linter.verify("let x = 5 ** 7;", {
parserOptions: { ecmaVersion: "latest" }
Expand Down

0 comments on commit 4977ae0

Please sign in to comment.