🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

eslint-plugin-react-func

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version

to
0.1.8

2

package.json
{
"name": "eslint-plugin-react-func",
"version": "0.1.7",
"version": "0.1.8",
"description": "max lines per function for react",

@@ -5,0 +5,0 @@ "keywords": [

@@ -52,7 +52,72 @@ # eslint-plugin-react-func

## Supported Rules
 
# max-lines-per-function
## Options
- "max" (default 50) enforces a maximum number of lines in a function.
- "skipBlankLines" (default false) ignore lines made up purely of whitespace.
- "skipComments" (default false) ignore lines containing just comments.
- "IIFEs" (default false) include any code included in IIFEs.
```json
{
"rules": {
"react-func/max-lines-per-function": [
"warn",
{
"max": 20,
"skipBlankLines": true,
"skipComments": true,
"IIFEs": true
}
],
}
}
```
### Bad
```javascript
/*eslint max-lines-per-function: ["error", 2]*/
function foo() {
var foo = 0;
var bar = 0;
var baz = 0;
}
```
### Good
```javascript
/*eslint max-lines-per-function: ["error", 2]*/
function foo() {
var foo = 0;
var bar = 0;
}
```
# max-combined-conditions
## Options
This rule has a numeric option (defaulted to 1)
```json
{
"rules": {
"react-func/max-combined-conditions": ["error", 1],
}
}
```
### Bad
```javascript
/*eslint max-combined-conditions: ["error", 0]*/
if (a < b && b > c) {
a = c
}
```
### Good
```javascript
/*eslint max-combined-conditions: ["error", 0]*/
const isBGreaterThanOthers = a < b && b > c
if (isBGreaterThanOthers) {
a = c
}
```