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

eslint-plugin-react-use-props

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-use-props

eslint plugin for enforce that all components that require or deprecate props

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
638
increased by4.08%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-react-use-props

ESLint plugin to require or deprecate props that components use

Installation

You'll first need to install ESLint:

# npm
npm install eslint --save-dev

# yarn
yarn add eslint --dev

Next, install eslint-plugin-react-use-props:

# npm
npm install eslint-plugin-react-use-props --save-dev

# yarn
yarn add eslint-plugin-react-use-props --dev

Usage

Add react-use-props to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["react-use-props"]
}

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

{
  "rules": {
    "react-use-props/require": [2,
      { "element": "img", "props": ["width", "height"] }
    ],
    "react-use-props/deprecate": [2,
      { "element": "div", "props": ["align"] }
    ]
  }
}

Recomended rules

Force required size props to prevent Layout Shift from occurring.

{
  "rules": {
    "react-use-props/require": [2,
      { "element": "img", "props": ["width", "height"] },
      { "element": "iframe", "props": ["width", "height"] }
    ]
  }
}

Supported Rules

Keywords

FAQs

Package last updated on 18 Jun 2021

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