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

Tips for Vim users who also use jshint #146

Closed
olalonde opened this issue May 28, 2015 · 7 comments

Comments

@olalonde
Copy link

commented May 28, 2015

  1. make sure your Syntastic is up to date (:PluginUpdate). standard support was only added a few months ago

  2. If you use other syntax checkers, add this to your .bashrc or .zshrc and launch vim with vims to enable standard.

alias vims="vim -c \"let g:syntastic_javascript_checkers = ['standard']\""

@olalonde olalonde closed this May 28, 2015

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented May 28, 2015

Or alternatively let vim auto detect your config in root, defaulting to standard if none is found:

autocmd FileType javascript let b:syntastic_checkers = findfile('.jshintrc', '.;') != '' ? ['jshint'] : ['standard']

source

@dcousens

This comment has been minimized.

Copy link
Member

commented May 28, 2015

Anyone have a snippet to instead use ./node_modules/bin/standard?

@olalonde

This comment has been minimized.

Copy link
Author

commented May 28, 2015

@yoshuawuyts nice. Do you have any idea on how I could have jshint as default and use standard only in projects which list it in package.json?

@yoshuawuyts

This comment has been minimized.

Copy link
Contributor

commented May 28, 2015

@olalonde no idea, I'm not much of a viml expert. You could shell out to node or jq, read the json and check for the values you're expecting.

@olalonde

This comment has been minimized.

Copy link
Author

commented May 28, 2015

@yoshuawuyts thanks, I'll see if I can come up with something.

@olalonde

This comment has been minimized.

Copy link
Author

commented Oct 8, 2015

autocmd FileType javascript let b:syntastic_checkers = findfile('node_modules/.bin/standard', '.;') != '' ? [ 'standard' ] : [ 'eslint' ]

seems to work as expected.

@rstacruz

This comment has been minimized.

Copy link
Member

commented Oct 8, 2015

as a neovim user i prefer https://github.com/benekastah/neomake. has built-in standard support and runs tools asynchronously (ie, no pause when you save files).

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.