Skip to content

Commit

Permalink
Add eslint rule for suite.only (microsoft#170994)
Browse files Browse the repository at this point in the history
Follow up from microsoft#170970
  • Loading branch information
mjbvz authored Jan 10, 2023
1 parent bd1d329 commit 09bfa65
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .eslintplugin/code-no-test-only.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export = new class NoTestOnly implements eslint.Rule.RuleModule {

create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener {
return {
['MemberExpression[object.name="test"][property.name="only"]']: (node: any) => {
['MemberExpression[object.name=/^(test|suite)$/][property.name="only"]']: (node: any) => {
return context.report({
node,
message: 'test.only is a dev-time tool and CANNOT be pushed'
message: 'only is a dev-time tool and CANNOT be pushed'
});
}
};
Expand Down

0 comments on commit 09bfa65

Please sign in to comment.