From c3cbb933fab74e00dbb6efff46be670b28f0efde Mon Sep 17 00:00:00 2001 From: Nicholas Jamieson Date: Thu, 31 Oct 2019 13:37:51 +1000 Subject: [PATCH] fix: Tighten RegExp. --- source/rules/rxjsNoRedundantNotifyRule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/rules/rxjsNoRedundantNotifyRule.ts b/source/rules/rxjsNoRedundantNotifyRule.ts index f3fc803e..eb579dca 100644 --- a/source/rules/rxjsNoRedundantNotifyRule.ts +++ b/source/rules/rxjsNoRedundantNotifyRule.ts @@ -26,7 +26,7 @@ export class Rule extends Lint.Rules.TypedRule { program: ts.Program ): Lint.RuleFailure[] { const failures: Lint.RuleFailure[] = []; - const query = `ExpressionStatement[expression.expression.name.text=/(complete|error)/] ~ ExpressionStatement[expression.expression.name.text=/(next|complete|error)/]`; + const query = `ExpressionStatement[expression.expression.name.text=/^(complete|error)$/] ~ ExpressionStatement[expression.expression.name.text=/^(next|complete|error)$/]`; const expressionStatements = tsquery(sourceFile, query); expressionStatements.forEach(node => { const expressionStatement = node as ts.ExpressionStatement;