Skip to content
This repository was archived by the owner on Aug 7, 2023. It is now read-only.

Ignore extensions #37

Merged
merged 10 commits into from
Sep 5, 2015
Merged

Conversation

beathyate
Copy link
Contributor

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

};
});

if (ignore) {
Copy link
Contributor

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.

Copy link
Contributor Author

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;
Copy link
Contributor

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 [];
Copy link
Contributor

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 👏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I’ll check

@steelbrain steelbrain self-assigned this Sep 5, 2015

for (let extension of ignored) {
if (fileExtension === extension) return [];
};
Copy link
Contributor

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 😛

@steelbrain
Copy link
Contributor

Thank you for your awesome contribution. 👏 🤘

steelbrain added a commit that referenced this pull request Sep 5, 2015
@steelbrain steelbrain merged commit 5719572 into AtomLinter:master Sep 5, 2015
@beathyate
Copy link
Contributor Author

Thanks I learned a lot from your comments 🤘

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linter applies on text.html.ruby
2 participants