🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-contains

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-contains

Checks that the given text exists in the file

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

eslint-plugin-contains

An ESLint rule which will search for a given string and fail with the given error if not found

To use:

Install the plugin

npm install eslint-plugin-contains --save-dev

Modify your .eslintrc file:

  • Add the plugin to the plugins array like this:
    "plugins": [
        "contains"
    ]
  • Add the rule to the rules object like this:
    "rules": {
        "contains/contains": [2, { "toFind": "this is the text to look for", "errorMessage": "An appropriate error message when not found"} ]
    }

Now verify the rule is checking as desired.

Keywords

eslint

FAQs

Package last updated on 29 Jan 2016

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