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

WIP: Type fixes #399

Merged
merged 5 commits into from
Mar 27, 2024
Merged

WIP: Type fixes #399

merged 5 commits into from
Mar 27, 2024

Conversation

dawaltconley
Copy link
Contributor

Partially addressing some type issues referenced in #396.

The second commit, which enforces correct types for various Astro components that were using type casting, surfaced some errors that the rest of the commits try to fix. Goal is just to get the project to pass npx astro check --minimumSeverity error.

There are still some errors in the way that the Features components are passing classes to the Headline component`, and I don't know the right way to handle those.

12:21:22 [check] Getting diagnostics for Astro files in /home/dawaltco/Code/forks/astrowind...
src/components/widgets/Features.astro:33:5 - error ts(2322): Type 'string' is not assignable to type 'Record<string, string>'.

33     classes={classes?.headline}
       ~~~~~~~

src/components/widgets/Features2.astro:32:5 - error ts(2322): Type 'string' is not assignable to type 'Record<string, string>'.

32     classes={classes?.headline}
       ~~~~~~~

src/components/widgets/Features3.astro:34:65 - error ts(2322): Type 'string' is not assignable to type 'Record<string, string>'.

34   <Headline title={title} subtitle={subtitle} tagline={tagline} classes={classes?.headline} />
                                                                   ~~~~~~~

src/pages/homes/startup.astro:55:4 - error ts(2322): Type '{ children: any; title: string; subtitle: string; }' is not assignable to type 'IntrinsicAttributes & Features'.
  Property 'items' is missing in type '{ children: any; title: string; subtitle: string; }' but required in type 'Features'.

55   <Features2
      ~~~~~~~~~

This surfaces some type errors in props being passed to some components,
particularly in the way Features passes the classes props.
Some of the amounts being passed, e.g. in homes/mobile-app.astro, cannot
easily be represented as numbers.
These props are already treated as optional in their components, and
sometimes not passed.
@prototypa
Copy link
Contributor

Awesome! Thank you so much @dawaltconley

The typescript errors that remain to be resolved and you mention, I think they are misunderstandings as to what type of data is being passed. I will check it.

@prototypa prototypa merged commit 29dc532 into onwidget:main Mar 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants