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

eslint-plugin-react-helpers

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 0.0.0 to 0.1.0

.idea/vcs.xml

4

docs/rules/no-named-useeffect-functions.md

@@ -1,3 +0,5 @@

# Disallows named function in useEffect hooks (`no-named-useeffect-functions`)
# Disallows named function in useEffect hooks (`react-helpers/no-named-useeffect-functions`)
<!-- end auto-generated rule header -->
Please describe the origin of the rule here.

@@ -4,0 +6,0 @@

@@ -42,3 +42,3 @@ /**

CallExpression(node) {
if (node.callee.name === 'useEffect') {
if (node.callee && node.callee.name === 'useEffect') {
if (node.arguments.length > 0) {

@@ -45,0 +45,0 @@ const inputFunction = node.arguments[0];

{
"name": "eslint-plugin-react-helpers",
"version": "0.0.0",
"version": "0.1.0",
"description": "A set of react eslint rules",

@@ -21,2 +21,3 @@ "keywords": [

"dependencies": {
"eslint-plugin-react-helpers": "^0.0.0",
"requireindex": "^1.2.0"

@@ -23,0 +24,0 @@ },

@@ -37,3 +37,3 @@ # eslint-plugin-react-helpers

"rules": {
"react-helpers/rule-name": 2
"react-helpers/prefer-use-state-lazy-initialization": 2
}

@@ -46,5 +46,10 @@ }

<!-- begin auto-generated rules list -->
TODO: Run eslint-doc-generator to generate the rules list.
| Name                                 | Description |
| :----------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- |
| [no-named-useeffect-functions](docs/rules/no-named-useeffect-functions.md) | Disallows named function in useEffect hooks |
| [prefer-use-state-lazy-initialization](docs/rules/prefer-use-state-lazy-initialization.md) | Detects function calls in useState and suggests using lazy initialization instead. |
<!-- end auto-generated rules list -->

@@ -38,3 +38,3 @@ /**

code: "useEffect(function myUseEffect() {})",
errors: [{ message: "Please do not name useEffect input functions.", type: "CallExpression" }],
errors: [{ message: rule.meta.messages.namedUseEffect, type: "CallExpression" }],
},

@@ -50,5 +50,5 @@ {

`,
errors: [{ message: "Please do not name useEffect input functions.", type: "CallExpression" }],
errors: [{ message: rule.meta.messages.namedUseEffect, type: "CallExpression" }],
},
],
});
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