I recently switched to using Brackets IDE to code on JavaScript. Upon realizing the default linter of Brackets was a very outdated version of JSLint, I followed some documentation and ended up installing the more versatile ESLint.
The problem is that this linter is only built for ECMA5, and does not even recognize the usage of keywords like const
.
There are some efforts from the community to improve JSLint into accepting ECMA6, but since I have been using ESLint in Cloud9 IDE for quite a while, I would like to keep it.
My reaction was to add the rules manually, in some eslint
configuration file, but after searching for it I couldn't find it.
An issue in the brackets-eslint project says the extension will pick up ESLint's standard .eslintrc
configuration files. Try putting this .eslintrc.json
in your project's root directory:
{
"root": true,
"parserOptions": {
"ecmaVersion": 6
},
"extends": "eslint:recommended"
}
You can find more options in ESLint's configuring guide. You can also run eslint --init
in your project's root directory to have ESLint walk you through setting up an initial configuration.
©2020 All rights reserved.