Repository: typeorm/typeorm
File: src/commands/InitCommand.ts (TypeScript)

Code before:
import { DataSource } from "typeorm"
import { User } from "./entity/User${isEsm ? ".js" : ""}"

export const AppDataSource = new DataSource({
    ${dbSettings}
    synchronize: true,
    logging: false,
    entities: [User],
    migrations: [],
    subscribers: [],
})
`
    }

    /**
     * Gets contents of the ormconfig file.
     */
    protected static getTsConfigTemplate(esmModule: boolean): string {
        if (esmModule)
            return JSON.stringify(
                {
                    compilerOptions: {
                        lib: ["es2023"],
                        target: "es2022",
                        module: "es2022",
                        moduleResolution: "node",
                        allowSyntheticDefaultImports: true,
                        outDir: "./build",
                        emitDecoratorMetadata: true,
                        experimentalDecorators: true,
                        sourceMap: true,
                    },
                },
                undefined,
                3,
            )
        else
            return JSON.stringify(
                {
                    compilerOptions: {
                        lib: ["es2023"],
                        target: "es2022",
                        module: "commonjs",
                        moduleResolution: "node",
                        outDir: "./build",
                        emitDecoratorMetadata: true,
                        experimentalDecorators: true,
                        sourceMap: true,
                    },
                },
                undefined,

Review comment (suggestion):
I think these were the compiler options for node16, which unfortunately we still support ;)

Would be great to keep this part unchanged.

Code after:
import { DataSource } from "typeorm"
import { User } from "./entity/User${isEsm ? ".js" : ""}"

export const AppDataSource = new DataSource({
    ${dbSettings}
    synchronize: true,
    logging: false,
    entities: [User],
    migrations: [],
    subscribers: [],
})
`
    }

    /**
     * Gets contents of the ormconfig file.
     */
    protected static getTsConfigTemplate(esmModule: boolean): string {
        if (esmModule)
            return JSON.stringify(
                {
                    compilerOptions: {
                        lib: ["es2021"],
                        target: "es2021",
                        module: "es2022",
                        moduleResolution: "node",
                        allowSyntheticDefaultImports: true,
                        outDir: "./build",
                        emitDecoratorMetadata: true,
                        experimentalDecorators: true,
                        sourceMap: true,
                    },
                },
                undefined,
                3,
            )
        else
            return JSON.stringify(
                {
                    compilerOptions: {
                        lib: ["es2021"],
                        target: "es2021",
                        module: "commonjs",
                        moduleResolution: "node",
                        outDir: "./build",
                        emitDecoratorMetadata: true,
                        experimentalDecorators: true,
                        sourceMap: true,
                    },
                },
                undefined,