victorporof / Sublime-JSHint

JSHint Gutter for Sublime Text 2 and 3 via node.js
https://github.com/victorporof/Sublime-JSHint
682 stars 71 forks source link

Support per-project/per-view settings #89

Closed int3h closed 10 years ago

int3h commented 10 years ago

This commit modifies the PluginUtils.get_pref() method to take an optional 'view' argument. If provided, get_pref() first looks in the view's settings object for the preference value, before looking in the global (package) settings.

This allows a user to override package settings on a per-project basic. For example, you can normally set "lint_on_edit": false in your JSHint.sublime-settings file. However, you can add "line_on_edit": true to the "settings" object in your project file, while will enable lint on edit mode for that specific project only.

In the future, we may want to namespace the settings keys ("lint_on_edit" becomes "jshintgutter_lint_on_edit", for example) to avoid preference name conflicts with other packages, since JSHint Gutter now effectively looks in the global options for its preferences first, before checking its own specific file.

victorporof commented 10 years ago

I think this is a great idea, but we should prefix those settings from the start. I really don't want us conflicting with other plugins.