ricardofbarros / linter-js-standard

Atom linter plugin for JavaScript, using JavaScript Standard Style
https://atom.io/packages/linter-js-standard
MIT License
99 stars 50 forks source link

[Linter] Invalid Linter Result received #180

Closed lukasoppermann closed 7 years ago

lukasoppermann commented 7 years ago

Hey I am getting this error:

Something bad happened astUtils.createGlobalLinebreakMatcher is not a function Referenced from: /Users/lukasoppermann/Code/veare/node_modules/standard/eslintrc.json

as well as

[Linter] Invalid Linter Result received These issues were encountered while processing messages from a linter named 'js-standard' • Linter Result must be an Array

I've got standard 10.0.2 installed in my repo and linter-js-standard@3.9.0. Any idea why this happens? It happens every time I save the file or write anything (so whenever the linter runs).

Thanks.

sonicdoe commented 7 years ago

Does this also happen when running standard from the command line? Also, could you post the output of npm ls eslint?

lukasoppermann commented 7 years ago

It seems to have been fixed with the latest update.

Arcanemagus commented 7 years ago

@sonicdoe This is still possible.

The problem looks to be that if there was an error thrown in a lintPromise, undefined will be returned as the .catch() block has no return statement.

I'd recommend returning null so that linter will simply keep it's current cache of messages for the provider (if it has any).

sonicdoe commented 7 years ago

@Arcanemagus Thanks 👍 Fixed in https://github.com/ricardofbarros/linter-js-standard/commit/32e8b7507b53eb56abc71e999892de813dd560c2.