victorporof/Sublime-JSHint — pull request #89 by int3h (2014-09-21 02:22:00+00:00)
Title: Support per-project/per-view settings

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.