Skip to content

Commit

Permalink
feat(vitest/valid-expect-in-promise): add rule (#569)
Browse files Browse the repository at this point in the history
* feat(vitest/valid-expect-in-promise): add rule

* chore(valid-expect): export rule

---------

Co-authored-by: Verite Mugabo <[email protected]>
  • Loading branch information
cardoso and veritem authored Nov 12, 2024
1 parent 0b67bef commit b7cd69a
Show file tree
Hide file tree
Showing 3 changed files with 2,127 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import paddingAroundBeforeEachBlocks, { RULE_NAME as paddingAroundBeforeEachBloc
import paddingAroundDescribeBlocks, { RULE_NAME as paddingAroundDescribeBlocksName } from "./rules/padding-around-describe-blocks"
import paddingAroundExpectGroups, { RULE_NAME as paddingAroundExpectGroupsName } from "./rules/padding-around-expect-groups"
import paddingAroundTestBlocks, { RULE_NAME as paddingAroundTestBlocksName } from "./rules/padding-around-test-blocks"
import validExpectInPromise, { RULE_NAME as validExpectInPromiseName } from './rules/valid-expect-in-promise'

const createConfig = <R extends Linter.RulesRecord>(rules: R) => (
Object.keys(rules).reduce((acc, ruleName) => {
Expand Down Expand Up @@ -135,7 +136,8 @@ const allRules = {
[paddingAroundBeforeEachBlocksName]: 'warn',
[paddingAroundDescribeBlocksName]: 'warn',
[paddingAroundExpectGroupsName]: 'warn',
[paddingAroundTestBlocksName]: 'warn'
[paddingAroundTestBlocksName]: 'warn',
[validExpectInPromiseName]: 'warn'
} as const

const recommended = {
Expand Down Expand Up @@ -215,7 +217,8 @@ const plugin = {
[paddingAroundBeforeEachBlocksName]: paddingAroundBeforeEachBlocks,
[paddingAroundDescribeBlocksName]: paddingAroundDescribeBlocks,
[paddingAroundExpectGroupsName]: paddingAroundExpectGroups,
[paddingAroundTestBlocksName]: paddingAroundTestBlocks
[paddingAroundTestBlocksName]: paddingAroundTestBlocks,
[validExpectInPromiseName]: validExpectInPromise
},
configs: {
'legacy-recommended': createConfigLegacy(recommended),
Expand Down
Loading

0 comments on commit b7cd69a

Please sign in to comment.