Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combined bases as a workaround for tsconfig.json extends limitations #89

Closed
jonahsnider opened this issue Feb 4, 2022 · 3 comments · Fixed by #90
Closed

Combined bases as a workaround for tsconfig.json extends limitations #89

jonahsnider opened this issue Feb 4, 2022 · 3 comments · Fixed by #90
Labels
enhancement New feature or request good first issue Good for newcomers you can do this

Comments

@jonahsnider
Copy link
Contributor

Following the addition of the "strictest" config there is now an issue for users who want to use "strictest" and another base from this repo (ex. "node16").

Could an additional script be added to generate combined bases?

ex. given the input of

[
	["strictest", "node16", "esm"],
	["strictest", "node16"]
]

output the bases

  • strictest-node16-esm/tsconfig.json
  • strictest-node16/tsconfig.json

Where "strictest-node16-esm` is defined as "esm" (a potential new base, see #76) extends "node16" extends "strictest".

@orta
Copy link
Member

orta commented Feb 4, 2022

Good idea.

Yep, I agree we should do these, and I think that is a good tactic. I think it should go [platform]-[additions]-[...additions] (so node16-esm-strictest or node16-strictest-esm, I don't mind either)

I feels right to document them as secondary in the repo README e.g. something like this:

Node 16 tsconfig.json

Install:

npm install --save-dev @tsconfig/node16
yarn add --dev @tsconfig/node16

Add to your tsconfig.json:

"extends": "@tsconfig/node16/tsconfig.json"

Also available as node16-esm-strictest .

@orta orta added enhancement New feature or request good first issue Good for newcomers you can do this labels Feb 4, 2022
@jonahsnider
Copy link
Contributor Author

jonahsnider commented Feb 4, 2022

I'll try playing around with ways to implement this later today soon-ish?? Someone else feel free to implement this if I don't have time to.
I plan to just Object.assign the bases together since using extends itself is very unpleasant (relies heavily on the file system and npm dependencies).
I think this is fine for UX as long as there is a note in the README to explain how the combined base was generated.

@orta
Copy link
Member

orta commented Feb 4, 2022

Yep, I think that's the right idea - I think it might be worth throwing if the values for something don't match too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers you can do this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants