Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,11 @@ def find_errors(self, output):
logger.error(output)
return

content = json.loads(output)
try:
content = json.loads(output)
except ValueError:
logger.error(output)
return

if logger.isEnabledFor(logging.INFO):
import pprint
Expand Down
3 changes: 2 additions & 1 deletion messages.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"install": "messages/install.txt"
"install": "messages/install.txt",
"4.0.1": "messages/4.0.1.txt"
}
42 changes: 42 additions & 0 deletions messages/4.0.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
SublimeLinter-eslint 4.0.1 [BREAKING!]
--------------------------------------

We switched to the new SL4 selectors. Which are awesome.

This replaces the old syntax_map as a ways to get this to work with "vue"
or the "eslint-plugin-html", or even with "Javascript (babel, next)" etc.

By default, this plugin will now *only* select "source.js",
which should work with most vue/babel/next flavors and embedded code.

It's also configurable. Open your SublimeLinter settings and set it to e.g.:

"eslint": {
"selector": "source.js, text.html.basic"
}


With the `eslint-plugin-html` installed, it will then take the whole file,
not just the scripts tags, and pass it to eslint.
Want it to grab `vue` files? "source.js, text.html.vue" for the win.


Other enhancements:

- We highlight errors that spread over multiple lines on ... multiple lines!
So, if you have an empty "if" block, we highlight the entire block.

- You can target different node version by setting, e.g.:
"executable": ["nvm", "exec", "8.9", "path/to/eslint"]
"executable": ["i/compiled/this/node", "path/to/eslint"]

- You can tweak the execution environment by setting, e.g.:
"env": {
"PATH": "/some/additional/path/bin:$PATH"
}