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

Add disableWhenNoJshintrcFileInPath option #144

Merged
merged 1 commit into from
Jul 20, 2015
Merged

Add disableWhenNoJshintrcFileInPath option #144

merged 1 commit into from
Jul 20, 2015

Conversation

hswolff
Copy link
Contributor

@hswolff hswolff commented Jul 19, 2015

Allows linter to be disabled if no jshintrc file is in project.

This is mostly lifted from linter-eslint.

@steelbrain
Copy link
Contributor

We are actually planning on support this steelbrain/linter#744
So I am not sure if this would be necessary :)

@hswolff
Copy link
Contributor Author

hswolff commented Jul 19, 2015

Right now not having this supported in this plugin makes my dev workflow pretty ugly, as I have to entirely disable the package when switching to some projects that I work on. Could we include this as a stop-gap until it's merged into linter itself?

@steelbrain
Copy link
Contributor

Sure, but you might wanna see AtomLinter/linter-eslint#172

@hswolff
Copy link
Contributor Author

hswolff commented Jul 19, 2015

I can update to use that - would that be all that you'd like to see done before merging?

@steelbrain
Copy link
Contributor

Yep, and if you could remove that notification that would be great.

@hswolff
Copy link
Contributor Author

hswolff commented Jul 19, 2015

Updated!

@@ -38,6 +42,12 @@ module.exports =
lintOnFly: true
lint: (textEditor) =>
filePath = textEditor.getPath()

onlyConfig = atom.config.get('linter-jshint.disableWhenNoJshintrcFileInPath')
jshintConfig = helpers.findFile(filePath, '.jshintrc')
Copy link
Contributor

Choose a reason for hiding this comment

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

can you check for config file only when the setting is enabled please, 'cause we don't wanna find it when the config is disabled

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch/optimization :D

@hswolff
Copy link
Contributor Author

hswolff commented Jul 20, 2015

Fixed.

@steelbrain
Copy link
Contributor

Nice! Thanks!

steelbrain added a commit that referenced this pull request Jul 20, 2015
Add `disableWhenNoJshintrcFileInPath` option
@steelbrain steelbrain merged commit 21abdb2 into AtomLinter:master Jul 20, 2015
@hswolff hswolff deleted the add-jshint-ignore branch July 20, 2015 00:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants