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

Make scopes a configuration setting #629

Merged
merged 6 commits into from
Jul 7, 2016
Merged

Conversation

neurosnap
Copy link
Contributor

This PR will allow the user to add or remove scopes that will apply to linter-eslint. The primary reason I am submitting this PR is for https://github.com/rtsao/csjs and by proxy https://github.com/neurosnap/language-csjs which will allow us to extend the linter to this pseudo language.

@@ -11,7 +11,7 @@ module.exports = {
this.subscriptions = new CompositeDisposable()
this.active = true
this.worker = null
this.scopes = ['source.js', 'source.jsx', 'source.js.jsx', 'source.babel', 'source.js-semantic']
this.scopes = atom.config.get('linter-eslint.scopes')
Copy link
Member

@Arcanemagus Arcanemagus Jul 5, 2016

Choose a reason for hiding this comment

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

Maintaining the scopes list isn't quite this simple. Your current code will only update on launching Atom, since that is (generally) the only time the activate() function is called.

You'll need to update this to code like this, so whenever the setting is changed, the scopes array is update (not replaced!) with the new values.

@@ -11,8 +11,14 @@ module.exports = {
this.subscriptions = new CompositeDisposable()
this.active = true
this.worker = null
this.scopes = atom.config.get('linter-eslint.scopes')
this.scopes = new CompositeDisposable()
Copy link
Member

Choose a reason for hiding this comment

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

this.scopes must be an Array

@Arcanemagus
Copy link
Member

@neurosnap A few more changes needed here.

@Arcanemagus
Copy link
Member

LGTM and CI is green, merging 😉.

Thanks for putting this together!

@Arcanemagus Arcanemagus merged commit ef8451d into AtomLinter:master Jul 7, 2016
@neurosnap
Copy link
Contributor Author

I'm glad we could get this merged. Thanks for all the input and examples, much appreciated!

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