- key-spacing
- padding-line-between-statements
...
Code Block |
---|
/*eslint padding-line-between-statements: [ "error", { blankLine: "always", prev: ["const", "let", "var"], next: "*"}, { blankLine: "any", prev: ["const", "let", "var"], next: ["const", "let", "var"]} ]*/ function foo() { var a = 0; var b = 0; bar(); } function foo() { let a = 0; const b = 0; bar(); } function foo() { const a = 0; const b = 0; bar(); } |
comma-dangle
currently:
Code Block |
---|
/*"only-multiline" allows (but does not require) trailing commas when the last element or property is in a different line than the closing ] or } and disallows trailing commas when the last element or property is on the same line as the closing ] or }*/ "comma-dangle": [ "error", { "arrays": "only-multiline", "objects": "only-multiline", "imports": "only-multiline", "exports": "only-multiline", "functions": "only-multiline" } ] |
...
This rule covers SonarCloud rule: Files should not have too many lines
max-lines: ["error", 1000]
prefer-destructuring [sonar]
...
This rule covers SonarCloud rule: Conditionally executed blocks should be reachable. Conditional expressions which are always true
or false
can lead to dead code. There shouldn't be expressions like if (false){}
...
Some of sonar rules are covered in the eslint plugin - https://github.com/SonarSource/eslint-plugin-sonarjs/blob/master/README.md
"no-empty-function": "error",
"no-empty": "error",
"max-lines-per-function": [
"error",
200
],
"max-params": [
"error",
7
],
"require-yield": "error",
"no-duplicate-imports": "error",
"no-labels": "error"