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 Rule | Preset |
|---|---|
conditionalExpectsEnforces that expect statements aren't conditionally executed. | logical |
describeCallbackValidity | logical |
expectValidity | logical |
nodeTestImportsReports importing from node:test. | logical |
snapshotLocalTextContexts | logical |
testBodyExpectations | logical |
testExports | logical |
titleRepeats | logical |
titleValidity | logical |
commentedOutTests | logicalStrict |
expectsOutsideTests | logicalStrict |
hoistedApiPositions | logicalStrict |
hookDuplicates | logicalStrict |
testConditionals | logicalStrict |
aliasMethods | stylistic |
comparisonMatcherAssertions | stylistic |
describeTitleReferences | stylistic |
eachLoops | stylistic |
equalityMatchers | stylistic |
expectResolves | stylistic |
promiseSettleAssertions | stylistic |
testCaseAssertions | stylistic |
testPrefixes | stylistic |
toBeTypeOfs | stylistic |
toContainMatchers | stylistic |
toHaveLengthMatchersReports equality matchers on .length that could use toHaveLength(). | stylistic |
vitestGlobalImports | stylistic |
calledOnceWithAssertions | stylisticStrict |
calledTimesAssertions | stylisticStrict |
calledWithAssertions | stylisticStrict |
hookOrders | stylisticStrict |
hooksBeforeTestCasesEnforces that all lifecycle hooks should come before all test cases. | stylisticStrict |
mockedFunctionInstances | stylisticStrict |
mockReturnShorthands | stylisticStrict |
mockTypeParameters | stylisticStrict |
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) |
