Be the first user to complete this post

  • 0
Add to List

Use es6 and es6+ in eslint with babel

It seems like Eslint does not support ES6/ES6+ experimental features out of the box at the time of writing. To do that you need to install a dev dependency called babel-eslint and then specify it to be the parser in your eslintrc file.

npm install --save-dev babel-eslint
//.eslintrc
{
  ...
  "parser": "babel-eslint",
  ...
}
With this your arrow functions wont complain anymore upon linting.



Also Read:

  1. exports is not defined
  2. Writing multiline sql queries in javascript using knex
  3. Reinitialize addthis after loading ajax content
  4. Dynamic module loading with require
  5. Use node in es6 syntax with babel transpiling
  6. Error handling in promises interview question
  7. Passing the store down implicitly via context in a react redux app
  8. combineReducers in reduxjs explained