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

chore(shadertools): Fully eliminate implicit typings #1619

Merged
merged 3 commits into from Nov 19, 2022
Merged

Conversation

ibgreen
Copy link
Collaborator

@ibgreen ibgreen commented Jan 31, 2022

For #1402

Background

  • Shadertools module has a number of complex input structures and overloaded types for hooks, modules etc.
  • Very little type checking makes the module error prone and hard to use.

Change List

  • Set noImplicitAny in shadertools module
  • Add/improves types to fix all errors

@ibgreen ibgreen changed the title Shadertools types chore(shadertools): Fully eliminate implicit typings Jan 31, 2022
@ibgreen ibgreen merged commit 9fd690e into master Nov 19, 2022
@ibgreen ibgreen deleted the shadertools-types branch November 19, 2022 13:57
};

const TYPE_DEFINITIONS = {
const TYPE_DEFINITIONS: Record<string, {validate: (value: unknown, propType: PropType) => boolean}> = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this would be better called VALIDATOR or similar

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is a good idea, addressed in #1679

const propTypes: Record<string, PropType> = {};


export function parsePropTypes(propDefs: Record<string, PropType>): Record<string, PropDef> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I find the types and parameter naming confusing. It's not clear why you chose to swap the names of the types but kept the parameter names.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch. Overhauled in same PR #1679

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.

None yet

2 participants