Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update: enable es2020 environment in --init (#13357)
  • Loading branch information
mdjermanovic committed Jun 4, 2020
1 parent 21b1583 commit d5fce9f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions lib/init/config-initializer.js
Expand Up @@ -265,11 +265,7 @@ function processAnswers(answers) {
};

config.parserOptions.ecmaVersion = espree.latestEcmaVersion;
config.env.es6 = true;
config.globals = {
Atomics: "readonly",
SharedArrayBuffer: "readonly"
};
config.env.es2020 = true;

// set the module type
if (answers.moduleType === "esm") {
Expand Down
4 changes: 1 addition & 3 deletions tests/lib/init/config-initializer.js
Expand Up @@ -136,9 +136,7 @@ describe("configInitializer", () => {
assert.deepStrictEqual(config.rules.quotes, ["error", "single"]);
assert.deepStrictEqual(config.rules["linebreak-style"], ["error", "unix"]);
assert.deepStrictEqual(config.rules.semi, ["error", "always"]);
assert.strictEqual(config.env.es6, true);
assert.strictEqual(config.globals.Atomics, "readonly");
assert.strictEqual(config.globals.SharedArrayBuffer, "readonly");
assert.strictEqual(config.env.es2020, true);
assert.strictEqual(config.parserOptions.ecmaVersion, espree.latestEcmaVersion);
assert.strictEqual(config.parserOptions.sourceType, "module");
assert.strictEqual(config.env.browser, true);
Expand Down

0 comments on commit d5fce9f

Please sign in to comment.