-
-
Notifications
You must be signed in to change notification settings - Fork 496
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(linter/eslint-plugin-vitest): implement no-restricted-vi-methods (…
- Loading branch information
Showing
5 changed files
with
100 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 35 additions & 5 deletions
40
crates/oxc_linter/src/snapshots/no_restricted_jest_methods.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,69 @@ | ||
--- | ||
source: crates/oxc_linter/src/tester.rs | ||
--- | ||
⚠ eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
╭─[no_restricted_jest_methods.tsx:1:6] | ||
1 │ jest.fn() | ||
· ── | ||
╰──── | ||
help: Use of `"fn"` is disallowed | ||
|
||
⚠ eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
╭─[no_restricted_jest_methods.tsx:1:6] | ||
1 │ jest["fn"]() | ||
· ──── | ||
╰──── | ||
help: Use of `"fn"` is disallowed | ||
|
||
⚠ eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
╭─[no_restricted_jest_methods.tsx:1:6] | ||
1 │ jest.mock() | ||
· ──── | ||
╰──── | ||
help: "Do not use mocks" | ||
|
||
⚠ eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
╭─[no_restricted_jest_methods.tsx:1:6] | ||
1 │ jest["mock"]() | ||
· ────── | ||
╰──── | ||
help: "Do not use mocks" | ||
|
||
⚠ eslint-plugin-jest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `jest.` methods | ||
╭─[no_restricted_jest_methods.tsx:3:22] | ||
2 │ import { jest } from '@jest/globals'; | ||
3 │ jest.advanceTimersByTime(); | ||
· ─────────────────── | ||
4 │ | ||
╰──── | ||
help: Use of `"advanceTimersByTime"` is disallowed | ||
|
||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `vi.` methods | ||
╭─[no_restricted_jest_methods.tsx:1:4] | ||
1 │ vi.fn() | ||
· ── | ||
╰──── | ||
help: Use of `"fn"` is disallowed | ||
|
||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `vi.` methods | ||
╭─[no_restricted_jest_methods.tsx:1:4] | ||
1 │ vi.mock() | ||
· ──── | ||
╰──── | ||
help: "Do not use mocks" | ||
|
||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `vi.` methods | ||
╭─[no_restricted_jest_methods.tsx:3:12] | ||
2 │ import { vi } from 'vitest'; | ||
3 │ vi.advanceTimersByTime(); | ||
· ─────────────────── | ||
4 │ | ||
╰──── | ||
help: Use of `"advanceTimersByTime"` is disallowed | ||
|
||
⚠ eslint-plugin-vitest(no-restricted-jest-methods): Disallow specific `vi.` methods | ||
╭─[no_restricted_jest_methods.tsx:1:4] | ||
1 │ vi["fn"]() | ||
· ──── | ||
╰──── | ||
help: Use of `"fn"` is disallowed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters