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" |
language/buddy
Section titled “language/buddy”The recommended language settings. Used by tsconfig/monorepo.
{ "compilerOptions": { "target": "ES2020", "useDefineForClassFields": true }}target: ES2020emits ES2020 syntax and loads the ES2020libby default.useDefineForClassFieldsemits class fields with ECMAScript[[Define]]semantics.- Extended on its own,
tsc --showConfig(TypeScript 7.0.2) also listsmodule: es2020, derived fromtarget. Extend a modules file to choose the module system.
language/metadata
Section titled “language/metadata”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:
{ "extends": [ "@repobuddy/typescript/tsconfig/monorepo", "@repobuddy/typescript/tsconfig/language/metadata" ], "compilerOptions": { "experimentalDecorators": true }}language/react
Section titled “language/react”Compiles JSX with the React 17+ automatic runtime (react/jsx-runtime).
{ "compilerOptions": { "jsx": "react-jsx" }}