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

Option to force lint by file extension or scope #372

Closed
augustobmoura opened this issue Mar 20, 2017 · 4 comments
Closed

Option to force lint by file extension or scope #372

augustobmoura opened this issue Mar 20, 2017 · 4 comments

Comments

@augustobmoura
Copy link
Contributor

There's a chance of adding a option forcing the linter to lint all files ending with .js? I want to use it with the package language-babel (primarily because of the es6 grammar), but it forces all JavaScript files to source.js.jsx. Maybe force to lint only certain scopes.

@Arcanemagus
Copy link
Member

This is a bug with language-babel that they marked as invalid, so it's highly unlikely to ever be fixed: gandm/language-babel#266

JSHint has no support for JSX so unfortunately that scope can't be added to the list of allowed scopes here.

@Arcanemagus
Copy link
Member

Closing as a duplicate of #348, I wish there was more that could be done here. I would just recommend using the built in language-javascript as it works perfectly fine.

@augustobmoura
Copy link
Contributor Author

augustobmoura commented Mar 21, 2017

It's not a duplicate, I'm asking for a field in the settings for force scopes to be linted, configurable by the user. I already do that editing the main.js of the apm package, but it's just a workaround, every update breaks it. I can work on a PR adding the option if I have the time, I think it's quite simple.

I use language-babel with plain js most of the time, and JSHint can handle that. JSX projects generally don't have a .jshintrc (because, as already said, jshint doesn't supports JSX) so enabling Disable When No Jshintrc File In Path option and forcing source.js.jsx scope works in most of the cases.

@Arcanemagus
Copy link
Member

I'd definitely be open to that, we have something similar in linter-eslint since it actually can support many different scopes.

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

No branches or pull requests

2 participants