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?

Answers:

Answer

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.

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.