Skip to content

feat(frontend): include vitest lint rules #5797

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
13 changes: 11 additions & 2 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { default as config } from '@dfinity/eslint-config-oisy-wallet/svelte';
import { default as svelteConfig } from '@dfinity/eslint-config-oisy-wallet/svelte';
import { default as vitestConfig } from '@dfinity/eslint-config-oisy-wallet/vitest';

export default [
...config,
...vitestConfig,
...svelteConfig,

{
rules: {
'vitest/expect-expect': ['off']
}
},

{
ignores: [
'**/.DS_Store',
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/tests/utils/console.test-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export const allowLoggingForDebugging = () => {
};

export const disableConsoleLog = () => {
// eslint-disable-next-line vitest/no-duplicate-hooks,vitest/prefer-hooks-in-order
beforeEach(() => {
// We mock console just to avoid unnecessary logs while running the tests
vi.spyOn(console, 'error').mockImplementation(() => {});
Expand Down