babel-eslint
Advanced tools
Comparing version 6.0.2 to 6.0.3
17
index.js
@@ -13,2 +13,3 @@ var babylonToEspree = require("./babylon-to-espree"); | ||
var hasPatched = false; | ||
var eslintOptions = {}; | ||
@@ -79,4 +80,7 @@ function createModule(filename) { | ||
escope.analyze = function (ast, opts) { | ||
opts.ecmaVersion = 6; | ||
opts.sourceType = "module"; | ||
opts.ecmaVersion = eslintOptions.ecmaVersion; | ||
opts.sourceType = eslintOptions.sourceType; | ||
if (eslintOptions.globalReturn !== undefined) { | ||
opts.nodejsScope = eslintOptions.globalReturn; | ||
} | ||
@@ -358,2 +362,9 @@ var results = analyze.call(this, ast, opts); | ||
options = options || {}; | ||
eslintOptions.ecmaVersion = options.ecmaVersion = options.ecmaVersion || 6; | ||
eslintOptions.sourceType = options.sourceType = options.sourceType || "module"; | ||
if (options.sourceType === "module") { | ||
eslintOptions.globalReturn = false; | ||
} else { | ||
delete eslintOptions.globalReturn; | ||
} | ||
@@ -372,3 +383,3 @@ try { | ||
var opts = { | ||
sourceType: options.sourceType || "module", | ||
sourceType: options.sourceType, | ||
strictMode: true, | ||
@@ -375,0 +386,0 @@ allowImportExportEverywhere: false, // consistent with espree |
{ | ||
"name": "babel-eslint", | ||
"version": "6.0.2", | ||
"version": "6.0.3", | ||
"description": "Custom parser for ESLint", | ||
@@ -25,4 +25,4 @@ "main": "index.js", | ||
"test": "mocha", | ||
"lint": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test", | ||
"fix": "./node_modules/eslint/bin/eslint.js index.js babylon-to-espree test --fix", | ||
"lint": "eslint index.js babylon-to-espree test", | ||
"fix": "eslint index.js babylon-to-espree test --fix", | ||
"preversion": "npm test" | ||
@@ -29,0 +29,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
34211
861