Make 2018 the default ecmaVersion for rules relying on parserOptions (babel/babel-eslint#556)
This commit is contained in:
parent
660180b932
commit
97c9442511
@ -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,
|
||||
};
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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",
|
||||
|
||||
@ -37,7 +37,7 @@ function parseAndAssertSame(code) {
|
||||
range: true,
|
||||
comment: true,
|
||||
attachComment: true,
|
||||
ecmaVersion: 8,
|
||||
ecmaVersion: 2018,
|
||||
sourceType: "module",
|
||||
});
|
||||
var babylonAST = babelEslint.parseForESLint(code, {
|
||||
@ -71,7 +71,7 @@ function parseAndAssertSame(code) {
|
||||
// assert.equal(esAST, babylonAST);
|
||||
}
|
||||
|
||||
describe("babylon-to-esprima", () => {
|
||||
describe("babylon-to-espree", () => {
|
||||
describe("compatibility", () => {
|
||||
it("should allow ast.analyze to be called without options", function() {
|
||||
var esAST = babelEslint.parseForESLint("`test`", {
|
||||
|
||||
@ -19,7 +19,7 @@ function verifyAndAssertMessagesWithSpecificESLint(
|
||||
es6: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 8,
|
||||
ecmaVersion: 2018,
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
experimentalObjectRestSpread: true,
|
||||
|
||||
@ -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"
|
||||
@ -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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user