steelbrain / linter-ui-default

Default UI for the Atom Linter package
MIT License
85 stars 47 forks source link

Don't propagate messages if filePath is undefined #666

Closed mauricioszabo closed 1 year ago

mauricioszabo commented 1 year ago

I found out that if I had a file with linter warnings, when I opened up a new file, this new, empty file would be decorated as if every line had a linter error (example below - notice that it also confuses the UI, as it now thinks that the error is on the first line).

Linter error

So I found that, in filterMessages, we get all messages and always add the message in the editor if filePath is not defined. This seems weird, and removing that line solves the issue, so I'm proposing this change. Let me know if there's something extra that I need to be aware of

Fixes #667