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

Commit

Permalink
Add configFile option to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Dec 18, 2018
1 parent 7a97f15 commit c99c3ae
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,19 @@ For questions and support please visit the [`#discussion`](https://babeljs.slack
## Known Issues

Flow:

> Check out [eslint-plugin-flowtype](https://github.com/gajus/eslint-plugin-flowtype): An `eslint` plugin that makes flow type annotations global variables and marks declarations as used. Solves the problem of false positives with `no-undef` and `no-unused-vars`.
- `no-undef` for global flow types: `ReactElement`, `ReactClass` [#130](https://github.com/babel/babel-eslint/issues/130#issuecomment-111215076)
- Workaround: define types as globals in `.eslintrc` or define types and import them `import type ReactElement from './types'`
- `no-unused-vars/no-undef` with Flow declarations (`declare module A {}`) [#132](https://github.com/babel/babel-eslint/issues/132#issuecomment-112815926)

Modules/strict mode

- `no-unused-vars: [2, {vars: local}]` [#136](https://github.com/babel/babel-eslint/issues/136)

Please check out [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) for React/JSX issues

- `no-unused-vars` with jsx

Please check out [eslint-plugin-babel](https://github.com/babel/eslint-plugin-babel) for other issues
Expand All @@ -45,12 +49,12 @@ It just needs to export a `parse` method that takes in a string of code and outp

### Supported ESLint versions

ESLint | babel-eslint
------------ | -------------
4.x | >= 6.x
3.x | >= 6.x
2.x | >= 6.x
1.x | >= 5.x
| ESLint | babel-eslint |
| ------ | ------------ |
| 4.x | >= 6.x |
| 3.x | >= 6.x |
| 2.x | >= 6.x |
| 1.x | >= 5.x |

### Install

Expand Down Expand Up @@ -80,6 +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, will use the path to config file given. 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 All @@ -90,9 +95,10 @@ Check out the [ESLint docs](http://eslint.org/docs/rules/) for all possible rule
"parser": "babel-eslint",
"parserOptions": {
"sourceType": "module",
"configFile": "path/to/config.js",
"allowImportExportEverywhere": false,
"ecmaFeatures": {
"globalReturn": false
"globalReturn": false
}
}
}
Expand Down

0 comments on commit c99c3ae

Please sign in to comment.