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

eslint-plugin-redos-detector

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-redos-detector

An eslint plugin that detects vulnerable regex using "https://github.com/tjenkinson/redos-detector".

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
735
decreased by-30.99%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-redos-detector

An eslint plugin that detects vulnerable regex using "RedosDetector". It processes all RegExp literals. I.e. /ab+c/ but not new RegExp('ab+c').

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-redos-detector:

npm i --save-dev eslint-plugin-redos-detector

Usage

Add redos-detector to the plugins section of your .eslintrc configuration file.

{
  "plugins": ["redos-detector"]
}

Then configure the rule under the rules section.

{
  "rules": {
    "redos-detector/no-unsafe-regex": "error"
  }
}

Or do the following to provide options.

{
  "rules": {
    "redos-detector/no-unsafe-regex": [
      "error",
      {
        "ignoreError": true
      }
    ]
  }
}

Options

  • ignoreError: If true any error getting results be ignored. It's possible for the detection to fail with some patterns, or if the patten is malformed or uses unsupported features. See this doc for the type of errors. (Default: false)
  • maxSteps: See the option in this doc with the same name. (Default: See linked doc)
  • maxResults: See the option in this doc with the same name. (Default: See linked doc)
  • timeout: See the option in this doc with the same name. (Default: See linked doc)

Keywords

FAQs

Package last updated on 04 Feb 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