Skip to content

Vitest Plugin

Rules for Vitest, a next generation testing framework built on Vite. It's fast!
This plugin is provided in a standalone @flint.fyi/plugin-vitest npm package.

Implemented: 11 of 58 (18.9%)
Flint RulePreset
conditionalExpectsEnforces that expect statements aren't conditionally executed.logical
describeCallbackValiditylogical
expectValiditylogical
nodeTestImportsReports importing from node:test.logical
snapshotLocalTextContextslogical
testBodyExpectationslogical
testExportslogical
titleRepeatslogical
titleValiditylogical
commentedOutTestslogicalStrict
expectsOutsideTestslogicalStrict
hoistedApiPositionslogicalStrict
hookDuplicateslogicalStrict
testConditionalslogicalStrict
aliasMethodsstylistic
comparisonMatcherAssertionsstylistic
describeTitleReferencesstylistic
eachLoopsstylistic
equalityMatchersstylistic
expectResolvesstylistic
promiseSettleAssertionsstylistic
testCaseAssertionsstylistic
testPrefixesstylistic
toBeTypeOfsstylistic
toContainMatchersstylistic
toHaveLengthMatchersReports equality matchers on .length that could use toHaveLength().stylistic
vitestGlobalImportsstylistic
calledOnceWithAssertionsstylisticStrict
calledTimesAssertionsstylisticStrict
calledWithAssertionsstylisticStrict
hookOrdersstylisticStrict
hooksBeforeTestCasesEnforces that all lifecycle hooks should come before all test cases.stylisticStrict
mockedFunctionInstancesstylisticStrict
mockReturnShorthandsstylisticStrict
mockTypeParametersstylisticStrict
testCasesWithinDescribesReports importing from node:test.stylisticStrict
afterAllPaddingLinesEnforces padding around afterAll blocks.(none)
afterEachPaddingLinesEnforces padding around afterEach blocks.(none)
allPaddingLinesEnforces padding around Vitest blocks.(none)
beforeAllPaddingLinesEnforces padding around beforeAll blocks.(none)
beforeEachPaddingLinesEnforces padding around beforeEach blocks.(none)
calledOnceAssertions(none)
describePaddingLinesEnforces padding around describe blocks.(none)
doneCallbacks(none)
eachForConsistency(none)
expectGroupPaddingLinesEnforces padding around expect groups.(none)
falsyMatchers(none)
filenames(none)
importsInMocks(none)
restrictedMatchers(none)
restrictedViMethods(none)
testCasePaddingLinesEnforces padding around test blocks.(none)
testDefinitionFunctions(none)
toHaveBeenCalledTimesAssertions(none)
truthyMatchers(none)
unnecessaryAsyncExpectFunctions(none)
viNamespaceNames(none)
vitestGlobalImporting(none)