diff --git a/README.md b/README.md index 526ad1fb..6227d3ad 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,7 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule ### Configuration - `sourceType` can be set to `'module'`(default) or `'script'` if your code isn't using ECMAScript modules. -- `configFile` Optional. If not defined, babel-eslint will use Babel's default configuration file resolution logic. Otherwise, it will use the path to config file given as a string here. See [Babel's documentation](https://babeljs.io/docs/en/options#configfile) for more details. +- `configFile` If defined, it will use the path to config file given as a string here. Otherwise, babel-eslint will use Babel's default configuration file resolution logic. See [Babel's documentation](https://babeljs.io/docs/en/options#configfile) for more details. - `allowImportExportEverywhere` (default `false`) can be set to `true` to allow import and export declarations to appear anywhere a statement is allowed if your build environment supports that. Otherwise import and export declarations can only appear at a program's top level. - `ecmaFeatures.globalReturn` (default `false`) allow return statements in the global scope when used with `sourceType: "script"`. diff --git a/lib/parse.js b/lib/parse.js index d0258a36..00286cf7 100644 --- a/lib/parse.js +++ b/lib/parse.js @@ -7,6 +7,7 @@ module.exports = function(code, options) { const opts = { sourceType: options.sourceType, configFile: options.configFile, + filename: options.filePath, parserOpts: { allowImportExportEverywhere: options.allowImportExportEverywhere, // consistent with espree allowReturnOutsideFunction: true,