website
                                
                                
                                
                                    website copied to clipboard
                            
                            
                            
                        @swc/jest: Config snippet does not pass TSC
The following config snippet from the docs does not pass TSC (after renaming the config file to .ts and adding type annotations):
module.exports = {
  transform: {
    "^.+\\.(t|j)sx?$": ["@swc/jest"],
  },
};
TSC:
TSError: ⨯ Unable to compile TypeScript:
jest.config.ts:14:3 - error TS2322: Type '[string]' is not assignable to type 'string | TransformerConfig'.
  Type '[string]' is not assignable to type 'string'.
'^.+\\.(t|j)sx?$': [ '@swc/jest' ],
I think it should be either @swc/jest as a plain string or [ '@swc/jest', {} ] with an empty record.