- key-spacing
- padding-line-between-statements
...
- react/sort-comp
- react/jsx-one-expression-per-line
- react/jsx-closing-bracket-location
react/jsx-closing-tag-location
react/jsx-wrap-multilines
react/jsx-curly-spacing
- no-array-constructor
- no-loop-func
- no-new-func
- max-lines
- prefer-destructuring
- eslint-plugin-filenames
- max-depth
key-spacing
currently: "key-spacing": "off"
...
Code Block |
---|
/*eslint max-len: ["error", { "code": 80 }]*/ var foo = { "bar": "This is a bar.", "baz": { "qux": "This is a qux" }, "easier": "to read" }; |
eol-last
Examples of incorrect code for this rule:
Covers SonarCloud Issue: Files should contain an empty newline at the end
Examples of incorrect code for this rule:
Code Block |
---|
/*eslint eol-last: ["error", "always"]*/ function doSmth() { var foo = 2; } |
...
This rule partly covers SonarCloud rule:
Examples of incorrect code for this rule:
...
Code Block |
---|
/*eslint no-array-constructor: "error"*/ Array(500) |
no-loop-func
This rule covers SonarCloud rule: Functions should not be defined inside loops
This rule covers SonarCloud rule: Functions should not be called both with and without "new" and Function constructors should not be used. Incorrect code:
Code Block |
---|
/*eslint no-new-func: "error"*/
function getNum() {
return 5;
}
var my2ndNum = new getNum(); // Noncompliant. An empty object is returned, NOT 5 |
max-lines
This rule covers SonarCloud rule: Files should not have too many lines
max-lines: ["error", 1000]
prefer-destructuring
This rule covers SonarCloud rule: Destructuring syntax should be used for assignments
Code Block |
---|
//Examples of incorrect code for this rule:
// With `array` enabled
var foo = array[0];
// With `object` enabled
var foo = object.foo;
var foo = object['foo'];
//Examples of correct code for this rule:
// With `array` enabled
var [ foo ] = array;
var foo = array[someIndex];
// With `object` enabled
var { foo } = object;
var foo = object.bar; |
eslint-plugin-filenames
This rule covers SonarCloud rule: Default export names and file names should match
"filenames/match-exported": "error"
max-depth
This rule covers SonarCloud rule: Control flow statements "if", "for", "while", "switch" and "try" should not be nested too deeply"filenames/match-exported": "error".
"max-depth": ["error", 3]