Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-batman-requires

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-batman-requires

prevent requiring modules from parent directories

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

batman-requires

eslint plugin to prevent requireing modules from parent directories. no parents. get it?

Image of Sad Batman

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/*"]
  }
}

FAQs

Package last updated on 01 May 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc