Skip to content

Commit 5bbb0b9

Browse files
authored
Merge pull request #210 from SublimeLinter/catch-decode-errors
Catch decode errors and prepare for 4.0.1
2 parents a86fe6b + 1033951 commit 5bbb0b9

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

linter.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ def find_errors(self, output):
4444
logger.error(output)
4545
return
4646

47-
content = json.loads(output)
47+
try:
48+
content = json.loads(output)
49+
except ValueError:
50+
logger.error(output)
51+
return
4852

4953
if logger.isEnabledFor(logging.INFO):
5054
import pprint

messages.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"install": "messages/install.txt"
2+
"install": "messages/install.txt",
3+
"4.0.1": "messages/4.0.1.txt"
34
}

messages/4.0.1.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
SublimeLinter-eslint 4.0.1 [BREAKING!]
2+
--------------------------------------
3+
4+
We switched to the new SL4 selectors. Which are awesome.
5+
6+
This replaces the old syntax_map as a ways to get this to work with "vue"
7+
or the "eslint-plugin-html", or even with "Javascript (babel, next)" etc.
8+
9+
By default, this plugin will now *only* select "source.js",
10+
which should work with most vue/babel/next flavors and embedded code.
11+
12+
It's also configurable. Open your SublimeLinter settings and set it to e.g.:
13+
14+
"eslint": {
15+
"selector": "source.js, text.html.basic"
16+
}
17+
18+
19+
With the `eslint-plugin-html` installed, it will then take the whole file,
20+
not just the scripts tags, and pass it to eslint.
21+
Want it to grab `vue` files? "source.js, text.html.vue" for the win.
22+
23+
24+
Other enhancements:
25+
26+
- We highlight errors that spread over multiple lines on ... multiple lines!
27+
So, if you have an empty "if" block, we highlight the entire block.
28+
29+
- You can target different node version by setting, e.g.:
30+
"executable": ["nvm", "exec", "8.9", "path/to/eslint"]
31+
"executable": ["i/compiled/this/node", "path/to/eslint"]
32+
33+
- You can tweak the execution environment by setting, e.g.:
34+
"env": {
35+
"PATH": "/some/additional/path/bin:$PATH"
36+
}
37+
38+
39+
40+
41+
42+

0 commit comments

Comments
 (0)