Add eslint rule for suite.only (#170994)

Follow up from #170970
This commit is contained in:
Matt Bierner 2023-01-10 10:57:05 -08:00 committed by GitHub
parent bd1d32980d
commit 09bfa65d9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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'
});
}
};