xo icon indicating copy to clipboard operation
xo copied to clipboard

xo.config.ts, AVA watch mode and VSCode

Open novemberborn opened this issue 7 months ago • 4 comments

When using an xo.config.ts file, and editing in VSCode with AVA's watch mode running and the XO extension installed, there is a brief window where xo.config.mjs files exist and are then deleted. This causes AVA to rerun all tests.

Is this expected behavior somewhere between XO and the VSCode extension? If it's unavoidable, should this be documented within XO, or AVA? Should AVA's watch mode always ignore XO and ESLint configuration files?

novemberborn avatar Jun 16 '25 13:06 novemberborn

Its part of cosmiconfig loading - we should potentially document this since it might trip up other file watching tools.

https://github.com/cosmiconfig/cosmiconfig/blob/main/src/loaders.ts#L118

spence-s avatar Jun 16 '25 18:06 spence-s

OK, that makes sense.

In your estimation, should AVA ignore *.config.* changes? We don't have a way for these hardcoded ignore patterns to be overruled.

novemberborn avatar Jun 16 '25 20:06 novemberborn

hmm it might be good default behavior, but I think I can imagine a scenario where you have a config stub or fixture that you do want to watch, so not being able to override it might be a little problematic.

spence-s avatar Jun 17 '25 14:06 spence-s

Do you expect these anywhere other than the project root? Or next to a package.json?

novemberborn avatar Jun 17 '25 14:06 novemberborn