GithubHelp home page GithubHelp logo

tjenkinson / eslint-plugin-redos-detector Goto Github PK

View Code? Open in Web Editor NEW
4.0 5.0 0.0 1.66 MB

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

License: MIT License

Shell 0.92% JavaScript 19.34% TypeScript 79.74%
eslint eslint-plugin redos-detector redos

eslint-plugin-redos-detector's Introduction

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)
  • maxBacktracks: 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)

eslint-plugin-redos-detector's People

Contributors

github-actions[bot] avatar renovate-bot avatar renovate[bot] avatar tjenkinson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

eslint-plugin-redos-detector's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/automerge.yml
  • tjenkinson/gh-action-auto-merge-dependency-updates v1
.github/workflows/build.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/codeql-analysis.yml
  • actions/checkout v4
  • github/codeql-action v2
  • github/codeql-action v2
.github/workflows/publish.yml
  • actions/checkout v4
  • actions/setup-node v4
nodenv
.node-version
  • node 18
npm
package.json
  • @rollup/plugin-node-resolve 15.2.3
  • @rollup/plugin-typescript 11.1.6
  • @types/eslint 8.56.10
  • @types/jest 29.5.12
  • @types/node 20.8.10
  • eslint 8.57.0
  • husky 8.0.3
  • jest 29.7.0
  • lint-staged 15.2.2
  • micromatch 4.0.5
  • prettier 3.2.5
  • redos-detector 5.1.0
  • rollup 4.17.2
  • ts-jest 29.1.2
  • tslib 2.6.2
  • typescript 5.4.5
  • eslint >=6

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.