tsconfig
tsconfig copied to clipboard
Shared TypeScript config for my projects
I don't want to do it yet as it will cause some friction. We can try to enable it in 2023. https://devblogs.microsoft.com/typescript/announcing-typescript-4-4/#exact-optional-property-types
Even with bugfix release v3.0.1 there seem to be an issue with typings from external packages. For example Ava does not seem to work after upgrading to v3. But this...
I'm currently looking into using `d.ts` files as a way to declare some types using imports from libraries without risking to import the libraries themselves. Example: ```ts // my.d.ts import...
See https://github.com/microsoft/TypeScript/issues/41139 As stated in https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#support-for-import-d-from-cjs-from-commonjs-modules-with---esmoduleinterop: > We highly recommend applying it both to new and existing projects. Should make TS and ESM work better together.
https://www.typescriptlang.org/tsconfig/#allowImportingTsExtensions Required for: ```ts import {addTests} from './collector.ts'; ``` Which is required by `node --experimental-strip-types` This is unrelated/unaffected by #29 I don't know what are the consequences of allowing `.ts`...
https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-4.html#support-for-require-calls-in---moduleresolution-bundler-and---module-preserve I think this is the right config to finally get TS out of the way ```js { "compilerOptions": { "module": "preserve", // ^ also implies: // "moduleResolution": "bundler", //...
From what I understand, `target: esnext` will avoid most code transforms by tsc, outputting exactly what the user authored. This is in a way similar to https://github.com/sindresorhus/tsconfig/issues/29 In full-typescript projects...
The best practice of TS is treating TS as a linter. Refer: https://www.typescriptlang.org/docs/handbook/modules/reference.html#summary
https://www.totaltypescript.com/erasable-syntax-only This might be a bit heavy handed for larger projects but I think it's the right path forward. I'd consider enabling this later this year. A drawback would be...
To stop import `.js` in typescript files https://www.typescriptlang.org/tsconfig/#rewriteRelativeImportExtensions