jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.26k stars 508 forks source link

Use tsconfig bases for the tsconfig in the template #753

Closed orta closed 4 years ago

orta commented 4 years ago

Current Behavior

Today my TSConfig looks like:

{
  "include": ["src", "types", "test"],
  "compilerOptions": {
    "target": "es5",
    "module": "esnext",
    "lib": ["dom", "esnext"],
    "importHelpers": true,
    "declaration": true,
    "sourceMap": true,
    "rootDir": "./",
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "noImplicitThis": true,
    "alwaysStrict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "moduleResolution": "node",
    "baseUrl": "./",
    "paths": {
      "*": ["src/*", "node_modules/*"]
    },
    "jsx": "react",
    "esModuleInterop": true
  }
}

It could be:

{
  "include": ["src", "types", "test"],
  "extends": "@tsconfig/tsdx"
}

Then when I make a change specific to my project it's very obvious:

{
  "include": ["src", "types", "test"],
  "extends": "@tsconfig/tsdx",
  "compilerOptions": {
        "noImplicitReturns": false
  }
}

See:

Who does this impact? Who is this for?

Should be useful to anyone regardless of their TS level

Describe alternatives you've considered

Don't, which is also OK

agilgur5 commented 4 years ago

Sounds like a duplicate of #634. That hasn't gotten many comments, however, though lots of related issues in support of it and this sounds directly in support for a tsconfig preset.

@orta is there any reason to use https://github.com/tsconfig/bases / @tsconfig/tsdx as opposed to hosting it under @tsdx/tsconfig? Looking to use a monorepo in the near future for presets, integrations, etc.

orta commented 4 years ago

No strong reason other than network effects of it being the same tool others use - I doubt we'll ever bake it into the compiler.