Skip to content
This repository has been archived by the owner on Aug 18, 2021. It is now read-only.

Make 2018 the default ecmaVersion for rules relying on parserOptions #556

Merged
merged 1 commit into from Jan 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/analyze-scope.js
Expand Up @@ -318,7 +318,7 @@ module.exports = function(ast, parserOptions) {
parserOptions.ecmaFeatures.globalReturn) === true,
impliedStrict: false,
sourceType: ast.sourceType,
ecmaVersion: parserOptions.ecmaVersion || 6,
ecmaVersion: parserOptions.ecmaVersion || 2018,
fallback,
};

Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -6,7 +6,7 @@ exports.parse = function(code, options) {

exports.parseForESLint = function(code, options) {
options = options || {};
options.ecmaVersion = options.ecmaVersion || 6;
options.ecmaVersion = options.ecmaVersion || 2018;
options.sourceType = options.sourceType || "module";
options.allowImportExportEverywhere =
options.allowImportExportEverywhere || false;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -45,7 +45,7 @@
"eslint-plugin-flowtype": "^2.30.3",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-prettier": "^2.1.2",
"espree": "^3.4.0",
"espree": "^3.5.2",
"husky": "^0.14.0",
"lint-staged": "^4.0.0",
"mocha": "^4.0.0",
Expand Down
4 changes: 2 additions & 2 deletions test/babel-eslint.js
Expand Up @@ -37,7 +37,7 @@ function parseAndAssertSame(code) {
range: true,
comment: true,
attachComment: true,
ecmaVersion: 8,
ecmaVersion: 2018,
sourceType: "module",
});
var babylonAST = babelEslint.parseForESLint(code, {
Expand Down Expand Up @@ -71,7 +71,7 @@ function parseAndAssertSame(code) {
// assert.equal(esAST, babylonAST);
}

describe("babylon-to-esprima", () => {
describe("babylon-to-espree", () => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is correct? I'm assuming this is a holdover from a long time ago :)

describe("compatibility", () => {
it("should allow ast.analyze to be called without options", function() {
var esAST = babelEslint.parseForESLint("`test`", {
Expand Down
2 changes: 1 addition & 1 deletion test/non-regression.js
Expand Up @@ -19,7 +19,7 @@ function verifyAndAssertMessagesWithSpecificESLint(
es6: true,
},
parserOptions: {
ecmaVersion: 8,
ecmaVersion: 2018,
ecmaFeatures: {
jsx: true,
experimentalObjectRestSpread: true,
Expand Down
11 changes: 0 additions & 11 deletions yarn.lock
Expand Up @@ -65,10 +65,6 @@ acorn@^3.0.4:
version "3.3.0"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a"

acorn@^5.0.1:
version "5.0.3"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.0.3.tgz#c460df08491463f028ccb82eab3730bf01087b3d"

acorn@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.2.1.tgz#317ac7821826c22c702d66189ab8359675f135d7"
Expand Down Expand Up @@ -599,13 +595,6 @@ eslint@^4.14.0:
table "^4.0.1"
text-table "~0.2.0"

espree@^3.4.0:
version "3.4.3"
resolved "https://registry.yarnpkg.com/espree/-/espree-3.4.3.tgz#2910b5ccd49ce893c2ffffaab4fd8b3a31b82374"
dependencies:
acorn "^5.0.1"
acorn-jsx "^3.0.0"

espree@^3.5.2:
version "3.5.2"
resolved "https://registry.yarnpkg.com/espree/-/espree-3.5.2.tgz#756ada8b979e9dcfcdb30aad8d1a9304a905e1ca"
Expand Down