From 18d4095c2d3db7772d473d858a4d868e025726a3 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 15 Apr 2019 09:23:37 -0700 Subject: [PATCH] test(eslint-plugin): arrow-paren: add extra case Also fix up the regex for vscode launching eslint-plugin tests so it matches all tests Closes #14 --- .vscode/launch.json | 3 ++- .../eslint-plugin/tests/eslint-rules/arrow-parens.test.ts | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 15c6b1bbb3d7..35c5c3194ec3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,7 +12,8 @@ "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", "args": [ "--runInBand", - "tests/rules/${fileBasenameNoExtension}" + // needs the '' around it so that the () are properly handled + "'tests/(.+/)?${fileBasenameNoExtension}'" ], "sourceMaps": true, "console": "integratedTerminal", diff --git a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts index d5dfed8a6472..e67ec96aed2c 100644 --- a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts @@ -13,6 +13,11 @@ ruleTester.run('arrow-parens', rule, { 'const foo = (t: T) => {};', 'const foo = ((t: T) => {});', 'const foo = function (t: T) {};', + ` +const foo = (bar: any): void => { + // Do nothing +} + `, { code: 'const foo = t => {};', options: ['as-needed'],