New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using babel-eslint as parser for esnext #3
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,14 @@ This is for advanced users. You probably want to use XO directly. | |
$ npm install --save-dev eslint-config-xo | ||
``` | ||
|
||
For the `esnext` version you'll also need Babel's ESLint [parser](https://github.com/babel/babel-eslint) and [plugin](https://github.com/babel/eslint-plugin-babel): | ||
|
||
``` | ||
$ npm install --save-dev babel-eslint eslint-plugin-babel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe mention below here some of the benefits with using the Babel parser. ES7 stuff, async/await, etc. So the user has some incentive to do the extra work. |
||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Annoying that this is needed. Could use some support on: eslint/eslint#3458 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't agree more! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, that's what I'm thinking too, but still doesn't solve it for people using this directly... |
||
|
||
This will let you use ES7/ES2016 features like [`async`/`await`](https://github.com/lukehoban/ecmascript-asyncawait) and [decorators](https://github.com/wycats/javascript-decorators). For a full list of features see [Babel's experimental features](https://babeljs.io/docs/usage/experimental/) and their [Learn ES2015](https://babeljs.io/docs/learn-es2015/). | ||
|
||
|
||
## Usage | ||
|
||
|
@@ -33,7 +41,7 @@ Or to `.eslintrc`: | |
} | ||
``` | ||
|
||
This package also exposes [`xo/esnext`](esnext.js) if you want ES2015 support and rules: | ||
This package also exposes [`xo/esnext`](esnext.js) if you want ES2015+ support and rules: | ||
|
||
```json | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is all this needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly to support
async
/await
, but see eslint-plugin-babel readme for more reasons.