Skip to content

Commit b1995d2

Browse files
committedDec 1, 2023
fix(consistent-list-newline): ignore arrow functions with one arg
1 parent 0fe4061 commit b1995d2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
 

‎src/rules/consistent-list-newline.test.ts

+14
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,20 @@ function TodoList() {
7272
},
7373
},
7474
},
75+
`
76+
bar(
77+
foo => foo
78+
? ''
79+
: ''
80+
)
81+
`,
82+
`
83+
bar(
84+
(ruleName, foo) => foo
85+
? ''
86+
: ''
87+
)
88+
`,
7589
]
7690

7791
// Check snapshot for fixed code

‎src/rules/consistent-list-newline.ts

+2
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ export default createEslintRule<Options, MessageIds>({
194194
)
195195
},
196196
ArrowFunctionExpression: (node) => {
197+
if (node.params.length <= 1)
198+
return
197199
check(
198200
node,
199201
node.params,

0 commit comments

Comments
 (0)
Please sign in to comment.