Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
veritem committed Dec 27, 2024
1 parent 5491010 commit 61ea8b4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ jobs:
- name: build
run: pnpm build

- name: typecheck
run: pnpm tsc
# - name: typecheck
# run: pnpm tsc
14 changes: 7 additions & 7 deletions src/rules/valid-title.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ type Options = {
allowArguments?: boolean
disallowedWords?: string[]
mustNotMatch?:
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
| MatcherAndMessage
| string
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
| MatcherAndMessage
| string
mustMatch?:
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
| MatcherAndMessage
| string
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
| MatcherAndMessage
| string
}[]

type CompiledMatcherAndMessage = [matcher: RegExp, message?: string]
Expand Down Expand Up @@ -91,7 +91,7 @@ const compileMatcherPatterns = (matchers:
| Partial<Record<MatcherGroups, string | MatcherAndMessage>>
| MatcherAndMessage
| string): Record<MatcherGroups, CompiledMatcherAndMessage | null> &
Record<string, CompiledMatcherAndMessage | null> => {
Record<string, CompiledMatcherAndMessage | null> => {
if (typeof matchers === 'string' || Array.isArray(matchers)) {
const compiledMatcher = compileMatcherPattern(matchers)

Expand Down
10 changes: 5 additions & 5 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Mostly adopted from https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/utils/accessors.ts
// Initial license: https://github.com/jest-community/eslint-plugin-jest/blob/main/LICENSE
// mostly adopted from https://github.com/jest-community/eslint-plugin-jest/blob/main/src/rules/utils/accessors.ts
// initial license: https://github.com/jest-community/eslint-plugin-jest/blob/main/LICENSE
import {
TSESLint,
AST_NODE_TYPES,
Expand All @@ -10,18 +10,18 @@ import {
KnownMemberExpression,
ParsedExpectVitestFnCall
} from './parse-vitest-fn-call'
import { RuleListener, RuleModule } from '@typescript-eslint/utils/ts-eslint'

export interface PluginDocs {
recommended?: boolean
requiresTypeChecking?: boolean
}

export function createEslintRule<TOptions extends readonly unknown[], TMessageIds extends string>(rule: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, PluginDocs>>) {
export function createEslintRule<TOptions extends readonly unknown[], TMessageIds extends string>(rule: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, PluginDocs>>): RuleModule<TMessageIds, TOptions, PluginDocs, RuleListener> {
const createRule = ESLintUtils.RuleCreator<PluginDocs>(
(ruleName: string) =>
(ruleName) =>
`https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/${ruleName}.md`
)

return createRule(rule)
}

Expand Down

0 comments on commit 61ea8b4

Please sign in to comment.