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

Refactor(repo): Use sharable typescript-config-spirit in tsconfig files #1787

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

literat
Copy link
Collaborator

@literat literat commented Dec 2, 2024

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

@github-actions github-actions bot added the refactoring A code change that neither fixes a bug nor adds a feature label Dec 2, 2024
Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for spirit-design-system ready!

Name Link
🔨 Latest commit 599ec3f
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system/deploys/675213ddeff26700083d4415
😎 Deploy Preview https://deploy-preview-1787--spirit-design-system.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95 (🔴 down 1 from production)
Accessibility: 91 (no change from production)
Best Practices: 100 (no change from production)
SEO: 91 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 2, 2024

Deploy Preview for spirit-design-system-storybook ready!

Name Link
🔨 Latest commit 599ec3f
🔍 Latest deploy log https://app.netlify.com/sites/spirit-design-system-storybook/deploys/675213dd8f31620008ef1910
😎 Deploy Preview https://deploy-preview-1787--spirit-design-system-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

exporters/js/tsconfig.json Outdated Show resolved Hide resolved
exporters/js/tsconfig.json Outdated Show resolved Hide resolved
@literat literat marked this pull request as ready for review December 5, 2024 08:34
@literat literat changed the title 🚧 Refactor(repo): Use sharable typescript-config-spirit in tsconfig files Refactor(repo): Use sharable typescript-config-spirit in tsconfig files Dec 5, 2024
@literat literat force-pushed the refactor/typescript-config-spirit branch from 665660b to 23fdaf3 Compare December 5, 2024 17:44
@coveralls
Copy link

Coverage Status

coverage: 79.469%. remained the same
when pulling 23fdaf3 on refactor/typescript-config-spirit
into c3ad4b2 on main.

@literat literat force-pushed the refactor/typescript-config-spirit branch from 23fdaf3 to bc41dfe Compare December 5, 2024 17:49
@literat literat force-pushed the refactor/typescript-config-spirit branch from ca1e505 to 599ec3f Compare December 5, 2024 20:58
{
"compileOnSave": true,
"compilerOptions": {
/* Visit https://aka.ms/tsconfig to read more about this file */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments in JSON 😨

Copy link
Collaborator Author

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 :-)

Copy link
Collaborator Author

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.

Copy link
Contributor

@adamkudrna adamkudrna left a 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",
Copy link
Contributor

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?

Copy link
Collaborator Author

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.
Copy link
Contributor

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"?

Copy link
Contributor

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 🙂.

Copy link
Collaborator Author

@literat literat Dec 17, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants