@@ -865,6 +865,52 @@ Other Style Guides
865865 // good
866866 new Date(...[2016, 8, 5]);
867867 ` ` `
868+ < a name= " functions--function-call-spacing" >< / a>< a name= " 7.15" >< / a>
869+ - [7.15 ](#functions-- function -call-spacing) Function argument spacing should be consistent within the function.
870+
871+ ```javascript
872+ /* eslint function-call-argument-newline: ["error", "consistent"]*/
873+
874+ foo("one", "two", "three");
875+ // or
876+ foo(
877+ "one",
878+ "two",
879+ "three"
880+ );
881+
882+ bar("one", "two", {
883+ one: 1 ,
884+ two: 2
885+ });
886+ // or
887+ bar (
888+ " one" ,
889+ " two" ,
890+ { one: 1 , two: 2 }
891+ );
892+ // or
893+ bar (
894+ " one" ,
895+ " two" ,
896+ {
897+ one: 1 ,
898+ two: 2
899+ }
900+ );
901+
902+ baz (" one" , " two" , (x ) => {
903+ console .log (x);
904+ });
905+ // or
906+ baz (
907+ " one" ,
908+ " two" ,
909+ (x ) => {
910+ console .log (x);
911+ }
912+ );
913+ ` ` `
868914
869915**[⬆ back to top](#table-of-contents)**
870916
@@ -935,6 +981,37 @@ Other Style Guides
935981 bool = true ;
936982 });
937983 ` ` `
984+ <a name="arrows--one-arg-parens"></a><a name="8.4"></a>
985+ - [8.4](#arrows--one-arg-parens) Include parentheses as-needed around arguments. eslint: [` arrow- parens` ](https://eslint.org/docs/rules/arrow-parens.html)
986+
987+ ` ` ` javascript
988+ // Incorrect
989+ (a ) => {};
990+ (a ) => a;
991+ (a ) => {' \n ' };
992+ a .then ((foo ) => {});
993+ a .then ((foo ) => a);
994+ a ((foo ) => { if (true ) {} });
995+ const f = /** @type {number} */ (a ) => a + a;
996+ const g = /* comment */ (a ) => a + a;
997+ const h = (a) /* comment */ => a + a;
998+
999+ // Correct
1000+ () => {};
1001+ a => {};
1002+ a => a;
1003+ a => {' \n ' };
1004+ a .then (foo => {});
1005+ a .then (foo => { if (true ) {} });
1006+ (a , b , c ) => a;
1007+ (a = 10 ) => a;
1008+ ([a , b ]) => a;
1009+ ({a, b}) => a;
1010+ const f = (/** @type {number} */ a ) => a + a;
1011+ const g = (/* comment */ a ) => a + a;
1012+ const h = (a /* comment */ ) => a + a;
1013+ ` ` `
1014+
9381015 <a name="arrows--confusing"></a><a name="8.5"></a>
9391016 - [8.5](#arrows--confusing) Avoid confusing arrow function syntax (` => ` ) with comparison operators (` <= ` , ` >= ` ). eslint: [` no- confusing- arrow` ](https://eslint.org/docs/rules/no-confusing-arrow)
9401017
0 commit comments