From 6d1eda89ac48c93c2675dcf24a92574a20b2edb9 Mon Sep 17 00:00:00 2001 From: Gareth Jones Date: Sun, 17 May 2020 20:29:38 +1200 Subject: [PATCH] fix(no-if): use correct syntax for placeholder substitution in message --- src/rules/__tests__/no-if.test.ts | 16 ---------------- src/rules/no-if.ts | 3 ++- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/src/rules/__tests__/no-if.test.ts b/src/rules/__tests__/no-if.test.ts index 1aff646cd..df0b95397 100644 --- a/src/rules/__tests__/no-if.test.ts +++ b/src/rules/__tests__/no-if.test.ts @@ -552,22 +552,6 @@ ruleTester.run('if statements', rule, { }, ], invalid: [ - { - code: ` - it('foo', () => { - switch (true) { - case true: { - } - } - }) - `, - errors: [ - { - data: { condition: 'if' }, - messageId: 'noConditionalExpect', - }, - ], - }, { code: `it('foo', () => { if('bar') {} diff --git a/src/rules/no-if.ts b/src/rules/no-if.ts index cb824368d..d6d71b014 100644 --- a/src/rules/no-if.ts +++ b/src/rules/no-if.ts @@ -43,7 +43,8 @@ export default createRule({ recommended: false, }, messages: { - noConditionalExpect: 'Test should not contain { condition } statements.', + noConditionalExpect: + 'Test should not contain {{ condition }} statements.', }, schema: [], type: 'suggestion',