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

eslint-plugin-react-hooks

Package Overview
Dependencies
Maintainers
7
Versions
2018
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-react-hooks - npm Package Compare versions

Comparing version 0.0.0-experimental-ae7ad8b4c-20220927 to 0.0.0-experimental-ae9017ce-20250122

cjs/eslint-plugin-react-hooks.production.js

2

index.js

@@ -6,5 +6,5 @@ 'use strict';

if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/eslint-plugin-react-hooks.production.min.js');
module.exports = require('./cjs/eslint-plugin-react-hooks.production.js');
} else {
module.exports = require('./cjs/eslint-plugin-react-hooks.development.js');
}
{
"name": "eslint-plugin-react-hooks",
"description": "ESLint rules for React Hooks",
"version": "0.0.0-experimental-ae7ad8b4c-20220927",
"version": "0.0.0-experimental-ae9017ce-20250122",
"repository": {

@@ -29,12 +29,16 @@ "type": "git",

},
"homepage": "https://reactjs.org/",
"homepage": "https://react.dev/",
"peerDependencies": {
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0"
"eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0"
},
"devDependencies": {
"@babel/eslint-parser": "^7.11.4",
"@typescript-eslint/parser-v2": "npm:@typescript-eslint/parser@^2.26.0",
"@typescript-eslint/parser-v3": "npm:@typescript-eslint/parser@^3.10.0",
"@typescript-eslint/parser-v4": "npm:@typescript-eslint/parser@^4.1.0",
"@typescript-eslint/parser-v5": "npm:@typescript-eslint/parser@^5.0.0-0"
"@typescript-eslint/parser-v5": "npm:@typescript-eslint/parser@^5.62.0",
"babel-eslint": "^10.0.3",
"eslint-v7": "npm:eslint@^7.7.0",
"eslint-v9": "npm:eslint@^9.0.0"
}
}
# `eslint-plugin-react-hooks`
This ESLint plugin enforces the [Rules of Hooks](https://reactjs.org/docs/hooks-rules.html).
This ESLint plugin enforces the [Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks).
It is a part of the [Hooks API](https://reactjs.org/docs/hooks-intro.html) for React.
It is a part of the [Hooks API](https://react.dev/reference/react/hooks) for React.

@@ -21,4 +21,6 @@ ## Installation

Then extend the recommended eslint config:
### Legacy Config (.eslintrc)
If you are still using ESLint below 9.0.0, please continue to use `recommended-legacy`. To avoid breaking changes, we still support `recommended` as well, but note that this will be changed to alias the flat recommended config in v6.
```js

@@ -28,3 +30,3 @@ {

// ...
"plugin:react-hooks/recommended"
"plugin:react-hooks/recommended-legacy"
]

@@ -34,2 +36,15 @@ }

### Flat Config (eslint.config.js)
For [ESLint 9.0.0 and above](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/) users, add the `recommended-latest` config.
```js
import reactHooks from 'eslint-plugin-react-hooks';
export default [
// ...
reactHooks.configs['recommended-latest'],
];
```
### Custom Configuration

@@ -39,2 +54,4 @@

#### Legacy Config (.eslintrc)
```js

@@ -54,3 +71,20 @@ {

#### Flat Config (eslint.config.js)
```js
import reactHooks from 'eslint-plugin-react-hooks';
export default [
{
files: ['**/*.{js,jsx}'],
plugins: { 'react-hooks': reactHooks },
// ...
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
}
},
];
```
## Advanced Configuration

@@ -76,3 +110,3 @@

Please refer to the [Rules of Hooks](https://reactjs.org/docs/hooks-rules.html) documentation and the [Hooks FAQ](https://reactjs.org/docs/hooks-faq.html#what-exactly-do-the-lint-rules-enforce) to learn more about this rule.
Please refer to the [Rules of Hooks](https://react.dev/reference/rules/rules-of-hooks) documentation to learn more about this rule.

@@ -79,0 +113,0 @@ ## License

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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