Skip to content

language

Files under @repobuddy/typescript/tsconfig/language/ match the Language and Environment category of the TSConfig reference.

File Sets
language/buddy target: "ES2020", useDefineForClassFields
language/metadata emitDecoratorMetadata
language/react jsx: "react-jsx"

The recommended language settings. Used by tsconfig/monorepo.

{
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true
}
}
  • target: ES2020 emits ES2020 syntax and loads the ES2020 lib by default.
  • useDefineForClassFields emits class fields with ECMAScript [[Define]] semantics.
  • Extended on its own, tsc --showConfig (TypeScript 7.0.2) also lists module: es2020, derived from target. Extend a modules file to choose the module system.

Emits design-type metadata for decorated declarations.

{
"compilerOptions": {
"emitDecoratorMetadata": true
}
}

This file does not set experimentalDecorators. TypeScript 6.0.3 and 7.0.2 both report TS5052: Option 'emitDecoratorMetadata' cannot be specified without specifying option 'experimentalDecorators' until your config sets it:

tsconfig.json
{
"extends": [
"@repobuddy/typescript/tsconfig/monorepo",
"@repobuddy/typescript/tsconfig/language/metadata"
],
"compilerOptions": {
"experimentalDecorators": true
}
}

Compiles JSX with the React 17+ automatic runtime (react/jsx-runtime).

{
"compilerOptions": {
"jsx": "react-jsx"
}
}