Skip to content

Commit 80e45be

Browse files
committed
fix: test extend in valid title
1 parent 1e86d8d commit 80e45be

File tree

3 files changed

+214
-209
lines changed

3 files changed

+214
-209
lines changed

src/rules/valid-title.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ type Options = {
4444
allowArguments?: boolean
4545
disallowedWords?: string[]
4646
mustNotMatch?:
47-
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
48-
| MatcherAndMessage
49-
| string
47+
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
48+
| MatcherAndMessage
49+
| string
5050
mustMatch?:
51-
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
52-
| MatcherAndMessage
53-
| string
51+
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
52+
| MatcherAndMessage
53+
| string
5454
}[]
5555

5656
type CompiledMatcherAndMessage = [matcher: RegExp, message?: string]
@@ -91,7 +91,7 @@ const compileMatcherPatterns = (matchers:
9191
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
9292
| MatcherAndMessage
9393
| string): Record<MatcherGroups, CompiledMatcherAndMessage | null> &
94-
Record<string, CompiledMatcherAndMessage | null> => {
94+
Record<string, CompiledMatcherAndMessage | null> => {
9595
if (typeof matchers === 'string' || Array.isArray(matchers)) {
9696
const compiledMatcher = compileMatcherPattern(matchers)
9797

@@ -197,6 +197,9 @@ export default createEslintRule<Options, MESSAGE_IDS>({
197197

198198
if (vitestFnCall?.type !== 'describe' && vitestFnCall?.type !== 'test' && vitestFnCall?.type !== 'it') return
199199

200+
// check if extend keyword have been used
201+
if (vitestFnCall.members.some(m => m.type == AST_NODE_TYPES.Identifier && m.name == "extend")) return
202+
200203
const [argument] = node.arguments
201204

202205
if (settings.typecheck) {

0 commit comments

Comments
 (0)