I'm setting up eslint with eslint-config-standard.
I'm also using babel plugin that @babel/plugin-proposal-class-properties.
I tried lint my javascript files by "eslint index.js" command, and I got error that "[eslint]: Parsing error: Unexpected token =".
So i installed babel-eslint, and I updated the file ".eslintrc" like this:
{
"extends": ["standard"],
"parser": "babel-eslint",
"rules": {
"eol-last": 0
}
}
The above configuration is solved error that "[eslint]: Parsing error: Unexpected token =", but i got new problem that eslint-config-standard configuration wasn't work anymore.
I want to use eslint-config-standard with experimental javascript code.
But i don't know how to use those together and whether is it possible.
How to use those together?
p.s. Sorry for my bad English :(
Yes it is possible. You just need to install a wrapper for Babel's parser used for ESLint and plugin.
https://github.com/babel/babel-eslint
https://github.com/babel/eslint-plugin-babel
$ npm install eslint babel-eslint eslint-plugin-babel --save-dev
# or
$ yarn add eslint babel-eslint eslint-plugin-babel -D
And then, inside your .eslintrc you need to add
"parser": "babel-eslint",
"plugins": ["babel"],
Also, if it doesn't work on the first try, you may need to restart your code editor. Good luck! :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With