Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move build settings to user settings. Add js_lint_folder command. #11

Closed
wants to merge 18 commits into from
Closed

Move build settings to user settings. Add js_lint_folder command. #11

wants to merge 18 commits into from

Conversation

janraasch
Copy link
Contributor

I really like your plugin, but the problem about using a .sublime-build is that though a user can edit the build settings in the Packages/JSLint/JSLint.sublime-build file, but those changes maybe overwritten any time the plugin is updated.

So:

  • I implemented a little helper command js_lint_exec, which basically runs a custom build reading the settings merged from the default Packages/JSLint/JSLint.sublime-settings and custom Packages/JSLint/JSLint.sublime-settings
  • This way we can still get the Jump to errors using F4 / Shift+F4 functionality for free.
  • Plus, using node-jslint we can now lint through folders using the filename filter defined in the settings and again Jump to errors using F4 / Shift+F4 even in different files easily.
  • In the end I kind of rewrote the whole plugin, but the main idea is still to leverage Sublime's in-built functionality of running terminal-commands like a build-script.
  • I did keep the default jslint options (like "--sloppy"...) and the keymap as you defined it to make the transition easy.
  • Also, I updated the README.md. In particular, I added a section on the problem which was discussed in [Errno 2] No such file or directory #8.

I do realize that this is basically a whole new plugin (codewise at least), but I don't want to add another sublimetext-jslint plugin to the package control repo, since there are already two of them. So, if you'd like to pull this stuff into your repo, please go ahead.

Jan Raasch added 18 commits April 30, 2013 23:39
Useful for sublime plugin development
Also, remove unnecessary keys  "caption" and "mnemonic".
* Add js_lint_folder and js_lint_containing_folder commands.
* Rename jslint to js_lint_file command.
* Add js_lint_exec helper command.
* Rename Default.sublime-commands to JSLint.sublime-commands as this is
the standard.
* Update context menu.
* Add menu item "JSLint Folder" to side bar context menu.
* Update sublime-commands.
This way linting multiple files (folders) is easy. Plus, it's nice to
use the standard.
@darrenderidder
Copy link
Collaborator

Awesome. Thanks!

@may-tau
Copy link

may-tau commented Oct 7, 2013

so how do I augment the .sublime-build file without getting it overwritten by each plugin-update? Where am I supposed to do it? Putting a custom JSLint.sublime-build to /Packages/User folder doesn't do the trick.

@may-tau
Copy link

may-tau commented Oct 7, 2013

UPD: I've found out it's done in .sublime-settings file (by looking into the .sublime-settings file here on github). I don't have that in my local .sublime-settings file though, my standard installed one contains only this:

{
    "filename_filter": "(\\.js|\\.css|\\.html|\\.json|\\.sass|\\.less)$"
}

Seems like the PackageControl doesn't load the new version of the plugin. Any idea why?

@may-tau
Copy link

may-tau commented Oct 7, 2013

UPD 2: ok, it's actually effective only in @janraasch tree.. why is this still not in the master branch?

@janraasch
Copy link
Contributor Author

There was a problem with Windows and node-jslint.

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

Successfully merging this pull request may close these issues.

3 participants