-
Notifications
You must be signed in to change notification settings - Fork 43
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
Rearchitecture: Type-Focused Fixers #1000
Comments
Core FixersA summary of all the resultant operations that exist today in core fixers... incompleteTypes
missingProperties
noImplicitAny
noImplicitThis
noInferableTypes
strictNonNullAssertions
Type OperationsGiven the above, these are all the unique operations I can think of. ExistingThese already exist:
ProjectedThese seem like ones that are likely to be needed eventually:
|
Core SearchesfixIncompleteTypesfixIncompleteImplicitClassGenerics
fixIncompleteImplicitVariableGenerics
fixIncompleteInterfaceOrTypeLiteralGenerics
fixIncompleteParameterTypes
fixIncompletePropertyDeclarationTypes
fixReactPropsFromUses
fixReactPropsFromLaterAssignments
fixReactPropFunctionsFromCalls
fixReactPropsFromPropTypes
fixIncompleteReturnTypes
fixIncompleteVariableTypes
fixMissingPropertiesfixMissingPropertyAccesses
fixNoImplicitAnyThe standard getNoImplicitAnyMutations:
fixNoImplicitAnyPropertyDeclarations
fixNoImplicitAnyParameters
fixNoImplicitAnyVariableDeclarations
fixNoImplicitThisThe standard getNoImplicitThisMutations:
fixNoImplicitThisPropertyDeclarations
fixNoInferableTypesfixNoInferableTypesParameters
fixNoInferableTypesPropertyDeclarations
fixNoInferableTypesVariableDeclarations
fixStrictNonNullAssertionsfixStrictNonNullAssertionBinaryExpressions
fixStrictNonNullAssertionCallExpressions
fixStrictNonNullAssertionObjectLiterals
fixStrictNonNullAssertionPropertyAccesses
fixStrictNonNullAssertionReturnTypes
Accumulated Search Operations
Deduplication Notes: Finding All References / TypesReact components inside fixIncompleteTypes have a lot of searching logic that ends up only looking at JSX attributes. |
Overview
I'm finding TypeStat to be suffering under its own code bloat for two major reasons:
|
union types to a declaration; adding in extra interface properties; ...any
to a real type; removing unused|
union types; ...Approach
I'd like to take roughly the following rearchitecture approach:
Convert fixers to using ts-simple-type, thereby removing the need for an "exposed" TypeScript 🎉No longer necessary not thatisAssignableTo
is public!Abstracting fixers into common operations instead of keying them into their own text printing comes with a couple of key advantages:
This issue replaces the more specific #124. Long term, I'd like to turn this into some kind of monorepo where the shared helpers can be exported as a standalone package for the community. That'll be a followup issue.
The text was updated successfully, but these errors were encountered: