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

Commit

Permalink
Pass filename to babelCore#parse
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Dec 18, 2018
1 parent d781b53 commit a342401
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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"`.

Expand Down
1 change: 1 addition & 0 deletions lib/parse.js
Expand Up @@ -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,
Expand Down

0 comments on commit a342401

Please sign in to comment.