You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+105
Original file line number
Diff line number
Diff line change
@@ -1053,6 +1053,24 @@ Other Style Guides
1053
1053
};
1054
1054
```
1055
1055
1056
+
- [8.6](#whitespace--implicit-arrow-linebreak) Enforce the location of arrow function bodies with implicit returns. eslint: [`implicit-arrow-linebreak`](https://eslint.org/docs/rules/implicit-arrow-linebreak)
1057
+
1058
+
```javascript
1059
+
// bad
1060
+
(foo) =>
1061
+
bar;
1062
+
1063
+
(foo) =>
1064
+
(bar);
1065
+
1066
+
// good
1067
+
(foo) => bar;
1068
+
(foo) => (bar);
1069
+
(foo) => (
1070
+
bar
1071
+
)
1072
+
```
1073
+
1056
1074
**[⬆ back to top](#table-of-contents)**
1057
1075
1058
1076
## Classes & Constructors
@@ -2664,6 +2682,93 @@ Other Style Guides
2664
2682
.fail(() => console.log('You have failed this city.'));
2665
2683
```
2666
2684
2685
+
- [19.13](#whitespace--block-spacing) Require consistent spacing inside an open block token and the next token on the same line. This rule also enforces consistent spacing inside a close block token and previous token on the same line. eslint: [`block-spacing`](https://eslint.org/docs/rules/block-spacing)
2686
+
2687
+
```javascript
2688
+
// bad
2689
+
function foo() {return true;}
2690
+
if (foo) { bar = 0;}
2691
+
2692
+
// good
2693
+
function foo() { return true; }
2694
+
if (foo) { bar = 0; }
2695
+
```
2696
+
2697
+
- [19.14](#whitespace--comma-spacing) Avoid spaces before commas and require a space after commas. eslint: [`comma-spacing`](https://eslint.org/docs/rules/comma-spacing)
2698
+
2699
+
```javascript
2700
+
// bad
2701
+
var foo = 1,bar = 2;
2702
+
var arr = [1 , 2];
2703
+
2704
+
// good
2705
+
var foo = 1, bar = 2;
2706
+
var arr = [1, 2];
2707
+
```
2708
+
2709
+
- [19.15](#whitespace--computed-property-spacing) Avoid spaces before commas and require a space after commas. eslint: [`computed-property-spacing`](https://eslint.org/docs/rules/computed-property-spacing)
2710
+
2711
+
```javascript
2712
+
// bad
2713
+
obj[foo ]
2714
+
obj[ 'foo']
2715
+
var x = {[ b ]: a}
2716
+
obj[foo[ bar ]]
2717
+
2718
+
// good
2719
+
obj[foo]
2720
+
obj['foo']
2721
+
var x = { [b]: a }
2722
+
obj[foo[bar]]
2723
+
```
2724
+
2725
+
- [19.16](#whitespace--func-call-spacing) Enforce spacing between functions and their invocations. eslint: [`func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing)
- [19.17](#whitespace--key-spacing) Enforce spacing between keys and values in object literal properties. eslint: [`key-spacing`](https://eslint.org/docs/rules/key-spacing)
- [19.18](#whitespace--no-trailing-spaces) Avoid trailing spaces at the end oflines. eslint: [`no-trailing-spaces`](https://eslint.org/docs/rules/no-trailing-spaces)
- [19.19](#whitespace--no-multiple-empty-lines) Avoid multiple empty lines and only allow one newline at the end offiles. eslint: [`no-multiple-empty-lines`](https://eslint.org/docs/rules/no-multiple-empty-lines)
0 commit comments