Skip to content

Commit

Permalink
fix(false positive): stop false positive (#340)
Browse files Browse the repository at this point in the history
* fix(false postive): stop rule from showing false positive when todo is used

* fix(linter): applied a linter
  • Loading branch information
veritem committed Dec 24, 2023
1 parent 71422ec commit 21dccf3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/rules/valid-describe-callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ export default createEslintRule<Options, MESSAGE_IDS>({

if (vitestFnCall?.type !== 'describe') return

if (vitestFnCall?.members[0]?.type === AST_NODE_TYPES.Identifier && vitestFnCall.members[0].name === 'todo')
return

if (node.arguments.length < 1) {
return context.report({
messageId: 'nameAndCallback',
Expand Down
1 change: 1 addition & 0 deletions tests/valid-describe-callback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { ruleTester } from './ruleTester'
'fdescribe("foo", () => {})',
'describe.only("foo", () => {})',
'describe.skip("foo", () => {})',
'describe.todo("runPrettierFormat");',
`
describe('foo', () => {
it('bar', () => {
Expand Down

0 comments on commit 21dccf3

Please sign in to comment.