-
Notifications
You must be signed in to change notification settings - Fork 15
Conversation
}; | ||
}); | ||
|
||
if (ignore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about if (ignore) return []
You don't need an else block as you are returning from the first one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that’s much better, thanks!
const filePath = activeEditor.getPath(); | ||
var ignore = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const fileExtension = Path.extname(filePath).substr(1)
documentation for Path.extname
Also, you should do const Path = require('path')
where the helpers are defined.
const fileExtension = Path.extname(filePath).substr(1); | ||
|
||
for (let extension of ignored) { | ||
if (fileExtension === extension.trim()) return []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think atom trims automatically for you when you use the type array. Can you please confirm? Other than that, awesome work on this PR 👏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I’ll check
|
||
for (let extension of ignored) { | ||
if (fileExtension === extension) return []; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this semi-colon is extra 😛
Thank you for your awesome contribution. 👏 🤘 |
Thanks I learned a lot from your comments 🤘 |
The linter-erb issue AtomLinter/linter-erb#9 is not resolved yet (linter-erb isn’t updated to use the new linter API) and I don’t how to fix it, this is my best alternative. I was also getting linter errors on markdown files so I included it’s extension as a default as well. I thinks those files should be excluded. Please let me know if this is acceptable. Thanks!
Closes #26