Interactive linting for Brackets
JavaScript CoffeeScript Other
Latest commit 829ae52 Nov 10, 2016 @MiguelCastillo committed on GitHub Merge pull request #182 from jwestbrook/master
split out embed/thread plugins and add PHP plugin
Permalink
Failed to load latest commit information.
img Copy status images from Brackets for use on non-linux machines. Sep 28, 2014
libs/js Fix use double quotes instead of single quotes Sep 6, 2015
plugins add new plugin for php syntax linting Jul 8, 2016
templates refactored line and char position to be in a `pos` object Apr 2, 2015
test adding sample jsx with es6 modules Apr 17, 2015
.brackets.json adding .brackets.json and eslintrc. Also made eslint the default linter Aug 15, 2015
.eslintrc updated stale eslint settings Aug 15, 2015
.gitignore Refactored plugins to have a dev directory and a default directory to… Nov 20, 2014
.jshintrc Fix merge mistake, and fix implementation of jQuery event handlers. Oct 10, 2014
CONTRIBUTING.md Correct the list of what to include on issue creation. Nov 22, 2014
LICENSE Initial commit of code Apr 9, 2013
ProblemWidget.js Use brackets.getModule("thirdparty/mustache/mustache") instead of glo… Sep 28, 2016
README.md Update README.md Sep 30, 2016
lintIndicator.js Fix use double quotes instead of single quotes Sep 6, 2015
lintPanel.js Fix #184 Aug 30, 2016
linterManager.js removed old commented out code Apr 2, 2015
linterReporter.js Fix use double quotes instead of single quotes Sep 6, 2015
linterSettings.js Use .on() on a Brackets module instead of $().on() Sep 27, 2016
main.js added missing copyright notices Mar 29, 2015
package.json Release v1.0.5 Jul 24, 2015
pluginLoader.js adjust plugin loader, manager and worker to understand threaded and e… Jul 8, 2016
pluginManager.js adjust plugin loader, manager and worker to understand threaded and e… Jul 8, 2016
pluginWorker.js revert change of quote types Jul 8, 2016
style.less adjusted width of light bulb in the gutter Apr 17, 2015
timer.js Added initial support for brackets preference Mar 26, 2015

README.md

Brackets-InteractiveLinter

Brackets integration with linters such as JSHint, JSLint, ESLint, JSCS, CoffeeLint, and more! Interactive Linter runs linters as you work on your code and gives instant feedback right on your document. You can access the details of the lint report by clicking on the light bulbs on the line gutters to the right of the document, or by using the keyboard shortcut Ctrl-Shift-E on that line.

Features

  • Real time feedback
  • Plugin system that runs plugins in a web worker
  • Traverses up the directory tree to load the most appropriate linter settings file
  • Let's you provide default linter settings that get mixed in with project specific ones. Reduce duplication!
  • Configure the linter settings file that gets loaded. Maybe you want to load jshintrc.json instead of .jshintrc
  • Configuration files are hot reload. So if you adjust your beloved .jshintrc, Interactive Linter will automatically reload it
  • Skips blocks of minified code to avoid cluttering your reports. (Minified code is determined by amount of characters per-line and simple heuristics)
  • Provides panel with a table of all errors and warning for easy navigation
  • Status indicator when your code is "happy", or when there are warnings and errors
  • Configuration via Brackets preferences system, which take effect in real time

Linters

A list of available linters can be found here, along with information about authoring your own plugins.

coffeescript

css

html

javascript

json

Configuration

Interactive Linter can be configured via Brackets' preferences system. For details on the brackets preferences, please take a look here.

Linter per language [run time]

You can specify which linter to run for each language independently, and changes are applied at run time. You can take a look at this sample configuration.

To specify eslint as your javascript linter, you need the follow changes to your .brackets.json.

{
    "interactive-linter.javascript": ["eslint"]
}

If you actually want to disable interactive linter javascript linting, you can set the linter language to null.

{
    "interactive-linter.javascript": null
}

You can customize other linters the same way by following the convention interactive-linter.[language]: ['linter-name']. For example, to disable linting for coffeescript you can do so with the following:

{
    "interactive-linter.javascript": ["eslint"],
    "interactive-linter.coffeescript": null
}

Delay [restart]

You can configure the delay for linting your documents. The value is specified in milliseconds, and by default it is 500. In the example below, the delay is configured to 1000 milliseconds (1 second):

{
    "interactive-linter.delay": 1000
}

JSHint/JSLint

Interactive Linter automatically loads .jshintrc and .jslintrc files in your project.

All JSHint settings that already exists inline in your JavaScript files will continue to work along side any .jshintrc/.jslintrc file.

Integration with http://jslinterrors.com/ to find out details about what's reported by JSHint.

Inspired by Joachim's extensions brackets-continuous-compilation.

CoffeeLint

Support for loading coffeelint.json as defined here.

Screenshots

jshint

coffeelint

Installation

Interactive Linter in available through Brackets extensions' registry.

FAQ

Can I configure default linter settings?

  • Yes you can. You will need to edit the default.json file located in the particular linter plugin's folder, and modify it with whatever default settings you desire. For example, if you want to set default settings for JSHint, you will need to navigate to the extensions/user/interactive-linter/plugins/jshint/default.json file and modify it accordingly. These settings are mixed in with any other settings found by Interactive Linter in your project.

Can I configure the settings file the linters load?

  • Yes you can. You will need to find settings.json for the particular linter plugin, and change the settingsFile field. For example, if you want to configure JSHint to load jshintrc.json instead of the default .jshintrc, find the file extensions/user/interactive-linter/plugins/jshint/settings.json and modify the settingsFile value with the file name you prefer.

Do you support JSX linting??

  • Yes. That's currently done via the jsx plugin. So you will need to set the javascript linter to jsx in your Brackets preferences file. The jsx linter will also lint your javascript document with JSHint. Good thing is that your .jshintrc will be used during the linting process. Bad thing is that you cannot specify another javascript linter besides JSHint to process your javscript document.
{
    "interactive-linter.javascript": ["jsx"]
}

Links

Contributors

Contact me

If you have any issues or want to just drop in a line, you can use my personal email at manchagnu@gmail.com.

License

Licensed under MIT