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

fix checkStyleSettings when path not found #174

Closed tjmehta closed 7 years ago

tjmehta commented 7 years ago

Open files in atom can be moved or deleted. When nonexistant files are listed, checkStyleSettings to returns undefined which causes #168. For now, I returned an empty object even when checkStyleSettings swallows any file read error.

ricardofbarros commented 7 years ago

Hey @tjmehta, thanks for the PR I will review shortly and get back at you. Thanks

tjmehta commented 7 years ago

Let me know if you have any questions :)

sonicdoe commented 7 years ago

I have fixed this in https://github.com/ricardofbarros/linter-js-standard/commit/3c9ad13f88853f2f804e9c2f76de011871eb3e60.

Instead of simply returning early, I have decided to use the path returned by TextEditor::getPath(). This allows us to honor the style settings specified in package.json even if the file does not exist in the file system (anymore).

Nevertheless, thank you, @tjmehta and @jscissr, for pointing us to the source of the error 👍