New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-dependency-cruiser

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-dependency-cruiser

Runs [Dependency Cruiser](https://github.com/sverweij/dependency-cruiser) as an [ESLint](https://eslint.org) rule and reports import rule violations.

  • 0.1.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
230
decreased by-20.96%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-dependency-cruiser

Runs Dependency Cruiser as an ESLint rule and reports import rule violations.

Installation

npm install --save-dev eslint-plugin

or

yarn add --dev eslint-plugin-dependency-cruiser

eslint-plugin-dependency-cruiser does not install Dependency Cruiser or ESLint for you. You must install these yourself.

Then, in your .eslintrc.js or .eslintrc.json:

{
  "plugins": ["dependency-cruiser"],
  "extends": ["plugin:dependency-cruiser/all"]
}

Configuration

By default the plugin looks for the Dependency Cruiser configuration and the baseline file in the default locations (.dependency-cruiser.js and .dependency-cruiser-known-violations.json). You can configure that using ESLint's settings, specifying dependency-cruiser key with a value of an object with config and knownViolations. Paths are relative to the project's root. For example:

{
  "plugins": ["dependency-cruiser"],
  "extends": ["plugin:dependency-cruiser/all"],
  "settings": {
    "dependency-cruiser": {
      "knownViolations": ".dependency-cruiser-baseline.json",
      "config": ".dependency-cruiser.cjs"
    }
  }
}

Limitations

The plugin is not exposing all validation features or configuration options of Dependency Cruiser's. Some things missing:

  • Support for loading webpack configuration
  • Support for detecting violations that require cruising the whole dependency tree, e.g. circular dependencies
  • Support for rule types other than forbidden (i.e. allowed and required)

FAQs

Package last updated on 18 Jul 2022

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