public
public copied to clipboard
Write wallaby config in alternative languages (e.g. TypeScript)
Is it possible to write wallaby.js
configuration in other languages such as TypeScript? Our entire codebase is in typescript and we try our best to keep it that way (so the compiler and linter and formatter can all do their job)
Right now it's not possible, so adding the feature request label.
I'm also interested in this feature; are there config types available we could use in the meantime via TSDoc?
@marionebl Can you please share your Wallaby config? Right now no config types are available.
I'd imagine something along the lines of
/**
* @type {import('wallaby').Config}
*/
const config = {
autoDetect: true,
tests: [
'**/*.test.ts',
'**/*.test.tsx',
{ pattern: '**/__tests__/**', ignore: true }
],
};
module.exports = config;
Prior art for this is eslint:
/**
* @type {import('eslint').Linter.Config}
*/
const config = {
/* ... */
}
module.exports = config;
@marionebl Thanks for sharing the config. We'll investigate adding config types.
Quick question: is the shared config just an example, or a real config?
/**
* @type {import('wallaby').Config}
*/
const config = {
autoDetect: true,
tests: [
'**/*.test.ts',
'**/*.test.tsx',
{ pattern: '**/__tests__/**', ignore: true }
],
};
module.exports = config;
The reason I'm asking is because it seems like the config may not be required at all (if your Jest config already specifies the right test patterns).
Quick question: is the shared config just an example, or a real config?
Thanks for checking in on it :) This is in fact a snippet of a real world config, but the real one is bigger - we need to define the patterns due to test files in __tests__
we know aren't compatible with wallaby.
due to test files in
__tests__
we know aren't compatible with wallaby
Interested to understand if these are jest
tests and to know if there's a problem with Wallaby we should be looking at for you?
Interested to understand if these are jest tests and to know if there's a problem with Wallaby we should be looking at for you?
No, those are playwright tests with a slightly different TypeScript setup - wouldn't expect Wallaby to support those.