Skip to content

Commit

Permalink
chore(lint): add complexity rules to picasso
Browse files Browse the repository at this point in the history
n
  • Loading branch information
OleksandrNechai committed Nov 13, 2019
1 parent 7f661dd commit 47eb406
Showing 1 changed file with 41 additions and 12 deletions.
53 changes: 41 additions & 12 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,38 @@
"@typescript-eslint/no-non-null-assertion": 1,
"@typescript-eslint/explicit-member-accessibility": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-use-before-define": [2, { "functions": false, "classes": false, "variables": false, "typedefs": false }],
"@typescript-eslint/no-use-before-define": [
2,
{
"functions": false,
"classes": false,
"variables": false,
"typedefs": false
}
],
"@typescript-eslint/no-explicit-any": 1,
"@typescript-eslint/ban-ts-ignore": 1
"@typescript-eslint/ban-ts-ignore": 1,

/**
* COMPLEXITY
* Ensure small functions and no nested/callback hell.
* If you need more, consider extracting some logic.
* Also you have cool destructuring feature, use it.
*/
"complexity": ["error", { "max": 11 }],
"max-params": ["error", 3],
"max-statements": ["error", 10],
"max-statements-per-line": ["error", { "max": 1 }],
"max-nested-callbacks": ["error", { "max": 2 }],
"max-depth": ["error", { "max": 3 }],
"max-lines": [
"error",
{
"max": 150,
"skipBlankLines": true,
"skipComments": true
}
]
},
"env": {
"jest": true
Expand All @@ -133,21 +162,21 @@
"fetch": true
},

"overrides": [
{
"files": ["*.example.jsx"],
"rules": {
"overrides": [
{
"files": ["*.example.jsx"],
"rules": {
"react/no-multi-comp": 0,
"react/require-optimization": 0,
"import/no-named-default": 0,
"no-console": 0
}
},
{
"files": ["src/components/**/*.tsx"],
"rules": {
}
},
{
"files": ["src/components/**/*.tsx"],
"rules": {
"no-restricted-imports": [2, "styled-components"]
}
}
}
]
}

0 comments on commit 47eb406

Please sign in to comment.