Closed kt3k closed 7 years ago
semistandard
uses the standard-engine
package (just like standard
) which intentionally ignores .eslintrc files, so this won't work the same way eslint does.
However, there is an --env
command line switch. So, you could run separate lint commands for each directory:
semistandard --env mocha test/**/*.js
semistandard --env browser browser/**/*.js
# fancy glob syntax to include all except test and browser directories
semistandard !(test|browser)/**/*.js
Perhaps setting up separate npm
scripts for each one will work?
Oh! one other option is to put this at the top of every test file:
/* eslint-env mocha */
And this at the top of every browser file:
/* eslint-env browser */
...This would allow for linting everything with a single command.
Thanks for the quick response!
Command line solution seems to work with our use case. Thank you :)
eslint seems to have configuration cascade feature. http://eslint.org/docs/user-guide/configuring#configuration-cascading-and-hierarchy
It works like:
I'm curious whether semistandard has this (or similar) feature. In our use case, we want to apply
env: ['mocha']
option to onlytest/
directory andenv: ['browser']
option to onlybrowser/
(browser specific directory) etc.