Socket
Socket
Sign inDemoInstall

eslint-plugin-no-one-time-vars

Package Overview
Dependencies
1
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    eslint-plugin-no-one-time-vars

Disallows one-time variables


Version published
Maintainers
2
Created

Readme

Source

eslint-plugin-no-one-time-vars

Disallows one-time variables

Installation

You'll first need to install ESLint:

npm i eslint --save-dev

Next, install eslint-plugin-no-one-time-vars:

npm install eslint-plugin-no-one-time-vars --save-dev

Usage

Add no-one-time-vars to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["no-one-time-vars"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "no-one-time-vars/no-one-time-vars": "error"
  }
}

To add an option to the rule configuration do the following:

{
  "rules": {
    "no-one-time-vars/no-one-time-vars": [
      "error",
      {
        "option-name": "option-value"
      }
    ]
  }
}

Supported Rules

  • no-one-time-vars

Supported Options

  • ignoredVariables
    • type: Array of strings
    • default: []
  • allowInsideCallback
    • type: Boolean
    • default: true
  • ignoreFunctionVariables
    • type: Boolean
    • default: true
  • ignoreArrayVariables
    • type: Boolean, Number
    • default: false
  • ignoreObjectVariables
    • type: Boolean
    • default: false
  • ignoreObjectDestructuring:
    • type: Boolean
    • default: false
  • ignoreExportedVariables:
    • type: Boolean
    • default: true

Keywords

FAQs

Last updated on 11 Aug 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc