-
Notifications
You must be signed in to change notification settings - Fork 1
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
Refactor(repo): Use sharable typescript-config-spirit in tsconfig files #1787
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for spirit-design-system ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for spirit-design-system-storybook ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
665660b
to
23fdaf3
Compare
23fdaf3
to
bc41dfe
Compare
ca1e505
to
599ec3f
Compare
{ | ||
"compileOnSave": true, | ||
"compilerOptions": { | ||
/* Visit https://aka.ms/tsconfig to read more about this file */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comments in JSON 😨
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that is just fine. Associate JSONC with JSON files in your IDE :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not kidding. The JSON format is really bad for storing configurations. Especially with the lack of comments. For a better understanding of configs, comments like these are necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I just don't feel qualified for a ✅.
{ | ||
"name": "typescript-config-spirit", | ||
"description": "TypeScript configuration for Spirit Design System", | ||
"version": "0.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v0.1.0 (the lowest correct semver version AFAIK) will be released automatically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, will be re-versioned with the next publish. However, we can start even with the 1.0.0
.
> `typescript-config-spirit/dom` | ||
|
||
This configuration extends the base configuration. | ||
It is fine to use this configuration for the code that is running in the DOM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-picking: can code be "run in DOM"? 🤔 Didn't you mean "in browser"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That might imply renaming this config to browser
. But I expect you will explain why I'm wrong 🙂.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/* If your code runs in the DOM: */
"lib": ["es2022", "dom", "dom.iterable"],
This configuration is the main reason why. So I name it after this. I was considering a "browser" but it will collide with this configuration and maybe it will be misleading.
It is just: base
- not running in DOM, dom
- running in DOM.
Description
Quick refactor of the same settings used across the
tsconfig.json
files.I am moving them into the common configuration.
Additional context
https://www.totaltypescript.com/tsconfig-cheat-sheet
Issue reference