Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 06538e3

Browse files
bradzacherJamesHenry
authored andcommitted
test(eslint-plugin): arrow-paren: add extra case (typescript-eslint#432)
1 parent 3f305b1 commit 06538e3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.vscode/launch.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
1313
"args": [
1414
"--runInBand",
15-
"tests/rules/${fileBasenameNoExtension}"
15+
// needs the '' around it so that the () are properly handled
16+
"'tests/(.+/)?${fileBasenameNoExtension}'"
1617
],
1718
"sourceMaps": true,
1819
"console": "integratedTerminal",

packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ ruleTester.run('arrow-parens', rule, {
1313
'const foo = <T>(t: T) => {};',
1414
'const foo = <T>((t: T) => {});',
1515
'const foo = function <T>(t: T) {};',
16+
`
17+
const foo = <T>(bar: any): void => {
18+
// Do nothing
19+
}
20+
`,
1621
{
1722
code: 'const foo = t => {};',
1823
options: ['as-needed'],

0 commit comments

Comments
 (0)