简体   繁体   中英

upgrade ESLint to ECMA6 Brackets IDE

Background

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 .

Problem

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.

What I tried

My reaction was to add the rules manually , in some eslint configuration file, but after searching for it I couldn't find it.

Question

  1. Is there a way to update ESLint rules on brackets IDE? If so, how?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM