🚀 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.6

39

lib/rules/max-combined-conditions.js

@@ -16,22 +16,5 @@ /**

const OPTIONS_SCHEMA = {
type: "object",
properties: {
max: {
type: "integer",
minimum: 0
}
},
additionalProperties: false
};
const OPTIONS_OR_INTEGER_SCHEMA = {
oneOf: [
OPTIONS_SCHEMA,
{
type: "integer",
minimum: 0
}
]
type: "integer",
minimum: 0
};

@@ -55,3 +38,3 @@

messages: {
unexpected: "too many combined conditions {{operatorNum}}. Maximum allowed is {{maxCombination}}."
unexpected: "too many combined conditions ({{operatorNum}}). Maximum allowed is {{maxCombination}}."
}

@@ -61,10 +44,7 @@ },

create(context) {
const option = context.options[0] || {};
let maxCombination = 1;
const defaultMaxCombination = 1;
let option = context.options[0] || defaultMaxCombination;
let maxCombination = defaultMaxCombination;
let operatorNum = 0;
if (typeof option === "object") {
maxCombination = typeof option.max === "number" ? option.max : 1;
}
if (typeof option === "number") {

@@ -86,2 +66,3 @@ maxCombination = option;

findOperatorNum(node);
console.log(operatorNum, maxCombination, context.options)
return operatorNum > maxCombination

@@ -101,4 +82,6 @@ }

messageId: "unexpected",
maxCombination,
operatorNum
data: {
maxCombination,
operatorNum
}
});

@@ -105,0 +88,0 @@ }

{
"name": "eslint-plugin-react-func",
"version": "0.1.5",
"version": "0.1.6",
"description": "max lines per function for react",

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