eslint-plugin-batman-requires
v0.0.2
Published
prevent requiring modules from parent directories
Downloads
8
Readme
batman-requires
eslint plugin to prevent require
ing modules from parent directories. no parents. get it?
installation
npm install eslint-plugin-batman-requires --save-dev
usage
and then in your .eslintrc
:
{
"plugins": [
"batman-requires"
],
"rules": {
"batman-requires/no-parents": 2
}
}
whitelisting files
sometimes you do actually want to require parents. like if you put tests
in a __tests__
directory right next to the modules, and each test file
requires its subject. rather than putting a custom .eslintrc
in every
__tests__
dir or putting eslint comments everywhere, you can just specify
some whitelist globs (minimatch-style) in your rule config, e.g.
{
"rules": {
"batman-requires/no-parents": [2, "**/__tests__/*", "moar", "patterns", "here/*"]
}
}