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

@susiandjames/eslint-plugin-id-denylist-regexp

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@susiandjames/eslint-plugin-id-denylist-regexp

Drop-in replacement for ESLint's rule id-denylist with support for RegExp

  • 1.0.0
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

eslint-plugin-id-denylist-regexp

Drop-in replacement for ESLint's rule id-denylist with support for regular expressions.

Installation

You'll first need to install ESLint:

npm install eslint --save-dev

Next, install eslint-plugin-id-denylist-regexp:

npm install @susiandjames/eslint-plugin-id-denylist-regexp --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-id-denylist-regexp globally.

Usage

Extend your eslint.config.js by the rule susiandjames/id-denylist as follows:

import susiandjames from "@susiandjames/eslint-plugin-id-denylist-regexp";

export default [
  {
    plugins: {
      susiandjames,
    },
    rules: {
      "susiandjames/id-denylist": [
        "warn",
        "/[0-9]+$/", // Disallow identifiers ending with numbers, e.g., `tmp0`
        "/(black|white)list/i", // Disallow identifiers containing the words "blacklist" and "whitelist" independent of their case sensitivity 
      ],
    },
  },
];

Note: Since ESLint's options need to serializable you have to indicate regular expressions by s

Keywords

FAQs

Package last updated on 25 Nov 2024

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