_Originally posted on StackOverflow but also opening here for reference._
At work we use a different syntax checker than I do when working on open source. Is there a way to have Syntastic specify a default checker, and change checkers if an rc file is found at the project root?
Example: if .eslintrc is found use eslint. If no .eslintrc is found, use standard.
Thanks!
Yes, you can do something like this:
autocmd FileType javascript let b:syntastic_checkers = findfile('.eslintrc', '.;') != '' ? ['eslint'] : ['standard']
@lcd047 thanks a lot!
Does it still work?
I tried and I can't see any syntax error even if I force one. This is my :SyntasticInfo output:
Syntastic version: 3.8.0-3 (Vim 800, Darwin)
Info for filetype: javascript.jsx
Global mode: active
Filetype javascript.jsx is active
The current file will be checked automatically
Available checkers: javascript/eslint javascript/standard
Currently enabled checker: javascript/eslint
This is the .eslintrc I have in project's root directory:
{"extends": ["standard"], "parser": "babel-eslint"}
Another team member uses the WebStorm IDE and it requires a .eslintrc in order to have standard working, as described here: http://standardjs.com/webstorm.html
So, basically:
eslintstantardBut I can't see any warning/error when I save or open a file with a ;, for example:

If I change my configuration to use only stantard as my default checker I can see it working:

Please open your test file, set g:syntastic_debug to 3, run the checker, run :mes, and post the output. Please use copy & paste rather than screenshots.
thanks @lcd047, debugging showed me that some packages was missing and that I should installed those globally :)
I implemented checker detection rules for most JavaScript and TypeScript checkers for my own use (e.g. looking for .eslintrc with various extensions, "eslintConfig" in package.json, etc.). I packaged it as a plugin (kevinoid/syntastic-detect-checkers) in case anyone else is interested in sharing checker detection rules. If there is any interest in including the rules in Syntastic, I would be happy to help merge it.
Most helpful comment
Yes, you can do something like this: