Currently for ESM projects we have this in vitest.setup.ts
// If vitest globals are enabled testing-library will clean up after each
// test automatically, but we don't enable globals, so we have to manually
// clean up here
// https://testing-library.com/docs/react-testing-library/api/#cleanup
And Greptile is complaining
Stale comment contradicts actual config
The comment says globals are not enabled, but vite.config.ts sets globals: true. With Vitest globals mode, @testing-library/react already auto-installs an afterEach cleanup, so this manual cleanup() call is redundant. The comment should be updated (or the manual call removed) to avoid confusion.
I made it global: true to make CJS -> ESM migration easier. And I want to keep it like this when I make ESM default.
Then, after ESM has been default for a while I want to switch to global: false.
But for now I should make the comment match the actual behavior.
Currently for ESM projects we have this in
vitest.setup.tsAnd Greptile is complaining
I made it
global: trueto make CJS -> ESM migration easier. And I want to keep it like this when I make ESM default.Then, after ESM has been default for a while I want to switch to
global: false.But for now I should make the comment match the actual behavior.