From e8d69705b345a0ca27d3de747c535f267a6d3dfa Mon Sep 17 00:00:00 2001 From: herr kaste Date: Mon, 5 Mar 2018 12:34:41 +0100 Subject: [PATCH 1/3] Catch JSON decode errors and present them as errors --- linter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/linter.py b/linter.py index c927bc5..b65c0fc 100644 --- a/linter.py +++ b/linter.py @@ -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 From 7cf9b29e0d0b354f6e98947b1bdbf868dbe46a92 Mon Sep 17 00:00:00 2001 From: herr kaste Date: Mon, 5 Mar 2018 13:00:15 +0100 Subject: [PATCH 2/3] Prepare 4.0.1 --- messages.json | 3 ++- messages/4.0.1.txt | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 messages/4.0.1.txt diff --git a/messages.json b/messages.json index ef56f9e..4f938c0 100644 --- a/messages.json +++ b/messages.json @@ -1,3 +1,4 @@ { - "install": "messages/install.txt" + "install": "messages/install.txt", + "4.0.1": "messages/4.0.1.txt" } diff --git a/messages/4.0.1.txt b/messages/4.0.1.txt new file mode 100644 index 0000000..d85c2dc --- /dev/null +++ b/messages/4.0.1.txt @@ -0,0 +1,53 @@ +SublimeLinter-eslint 4.0.1 +-------------------------- + + +[BREAKING] again. We switched to the new SL4 selectors. What does that mean? +The whole `syntax` stuff and how I get this to work with `vue` or the +`eslint-plugin-html`, or even with "Javascript (super-next, next)" has been revisited. + +By default, this plugin will now *only* select `source.js` +marked code, so it also lints embedded code in html. + +But this is finally pluggable. Go to your settings, the User settings or +project settings, and set it to e.g.: + +``` + "eslint": { + "selector": "source.js, text.html.basic" + } + +``` + +*iff* you have the `eslint-plugin-html` installed. Then the plugin will 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. + + +Enhancement: + +- We show errors that spread over multiple lines on ... multiple lines! + So, if you have an empty if block, we select the block not the if. + + +Tips and tricks: + +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: + + `"env": { + "PATH": "/some/additional/path/bin:$PATH" + }` + + + + + + From 10339518ff3b8afcf12d03d78126f14c5f98d6e1 Mon Sep 17 00:00:00 2001 From: Koen Lageveen Date: Mon, 5 Mar 2018 17:11:13 +0100 Subject: [PATCH 3/3] docs --- messages/4.0.1.txt | 59 +++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 35 deletions(-) diff --git a/messages/4.0.1.txt b/messages/4.0.1.txt index d85c2dc..4435721 100644 --- a/messages/4.0.1.txt +++ b/messages/4.0.1.txt @@ -1,50 +1,39 @@ -SublimeLinter-eslint 4.0.1 --------------------------- +SublimeLinter-eslint 4.0.1 [BREAKING!] +-------------------------------------- +We switched to the new SL4 selectors. Which are awesome. -[BREAKING] again. We switched to the new SL4 selectors. What does that mean? -The whole `syntax` stuff and how I get this to work with `vue` or the -`eslint-plugin-html`, or even with "Javascript (super-next, next)" has been revisited. +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` -marked code, so it also lints embedded code in html. +By default, this plugin will now *only* select "source.js", +which should work with most vue/babel/next flavors and embedded code. -But this is finally pluggable. Go to your settings, the User settings or -project settings, and set it to e.g.: +It's also configurable. Open your SublimeLinter settings and set it to e.g.: -``` - "eslint": { - "selector": "source.js, text.html.basic" - } + "eslint": { + "selector": "source.js, text.html.basic" + } -``` -*iff* you have the `eslint-plugin-html` installed. Then the plugin will take -the whole file, not just the scripts tags and pass it to eslint. +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. -Want it to grab `vue` files: "source.js, text.html.vue" for the win. +Other enhancements: -Enhancement: +- We highlight errors that spread over multiple lines on ... multiple lines! + So, if you have an empty "if" block, we highlight the entire block. -- We show errors that spread over multiple lines on ... multiple lines! - So, if you have an empty if block, we select the block not the if. +- 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"] - -Tips and tricks: - -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: - - `"env": { - "PATH": "/some/additional/path/bin:$PATH" - }` +- You can tweak the execution environment by setting, e.g.: + "env": { + "PATH": "/some/additional/path/bin:$PATH" + }