Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable JSLint ES6 errors with const and let in Adobe Brackets?

I have Googled and looked through this site everywhere, but I can only find answers for JSHint instead of JSLint. To get rid of the "use function form of use strict" error I add in /*jslint node: true */. But to disable errors for using const and let I can't seem to find anything. JSHint has esversion: 6 but this doesn't work on JSLint.

screenshot

like image 271
bdbdbd Avatar asked May 22 '16 19:05

bdbdbd


1 Answers

Use the Preferences API:

var PreferencesManager = brackets.getModule("preferences/PreferencesManager");

prefs = PreferencesManager.getExtensionPrefs("jslint");

prefs.set("options.es6", true);

Or set it one of the config files:

  • the brackets.json file of the user directory

or:

  • the .brackets.json file of the project directory:

As such:

{
    "jslint.options": {
        "es6": true
     }
}

References

  • brackets: .brackets.json

  • brackets: jslint extension - main.js

  • brackets wiki: Preferences Overview

  • PreferencesManager - Brackets API

like image 96
Paul Sweatte Avatar answered Sep 22 '22 16:09

Paul Sweatte