Skip to content

Commit

Permalink
fix: adding root files in eslint command
Browse files Browse the repository at this point in the history
  • Loading branch information
willmendesneto committed Dec 17, 2023
1 parent 6500eee commit eb7063f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -13,7 +13,7 @@
"test:watch": "vitest --reporter verbose",
"tsc:check": "tsc --noEmit",
"//--": "------------------- LINTING SCRIPTS ----------------------------",
"lint": "eslint src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint": "eslint *.ts src --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"build": "tsc && vite build",
"preview": "vite preview"
},
Expand Down
20 changes: 10 additions & 10 deletions setupTests.ts
@@ -1,26 +1,26 @@

import { expect, afterEach, vi } from 'vitest'
import { cleanup } from '@testing-library/react'
import matchers from '@testing-library/jest-dom/matchers'
import matchers from '@testing-library/jest-dom/matchers';
import { cleanup } from '@testing-library/react';
import { setLogger } from 'react-query';
import { afterEach, expect, vi } from 'vitest';

import { setupI18n } from './src/lib/i18n';

void setupI18n()
void setupI18n();

// extends Vitest's expect method with methods from react-testing-library
expect.extend(matchers)
expect.extend(matchers);


vi.stubGlobal('scrollTo', vi.fn())
vi.stubGlobal('scrollTo', vi.fn());

setLogger({
log: console.log,
warn: console.warn,
// ✅ no more errors on the console
// They will get caught and handled accordingly, just not adding any trace noise on test suite
error: () => null,
});

// runs a cleanup after each test case (e.g. clearing jsdom)
afterEach(() => {
cleanup()
})
cleanup();
});

0 comments on commit eb7063f

Please sign in to comment.