Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added tsconfig.json. Modified eslint config * Convert src/cleanup.js to TypeScript * Change src/cleanup.ts to use inline types * revert eslintrc * disable eslint for cleanup import this can be reverted when `pure.js` is converted to typescript * convert index to typescript just a rename 😅 * BREAKING CHANGE: Worked on typing asyncUtils. Removed deprecated wait. Disabled import/no-unresolved for now * Fix incorrect cleanup callback type * asyncUtils has been updated. Two lines are disabled for eslint. * remove unnecessary eslint disable * Prettier was stripping try catch types - see: https://prettier.io/blog/2020/08/24/2.1.0.html\#type-annotations-on-catch-clauses-8805httpsgithubcomprettierprettierpull8805-by-fiskerhttpsgithubcomfisker - Updated prettier in local devDeps to resolve directly to newest supported version * Type for callback handle generic input & undefined handled by nullish operator TS expecting explicit return of undefined from arrow function with type Expected to return a value at the end of arrow function.eslintconsistent-return resolved by passing return in catch with undefined, same behavior more explicit * comments for review * VoidFunction in place for void until decided behavior for waitFor() * Utilizing OR operator with generic Types allows for desired behavior and previous tests pass * mistakenly left out linter ignores in last commit * Minimum types started for Pure file - File needs better, improved typing and Refactoring for Linter Disables to be removed IF POSSIBLE * removed comments -- answered in PR - Types and OR check should handle expected behavior * Generic HTML types for initialProps * Generic HTML types for initialProps * Generic type for callback and initialProps * Generics added and CB toplevel same generic pattern added * force rebuild with unbound method eslint ignore * parser issue -- attempt to fix by removing specific TS eslint rule * Newer versions of ESLint might resolve the parser issue * Added configs to get started on test conversion * Generic type for resultContainer this should allow typescript to infer the type of result.current further improvments needed to add type guards * convert tests that require no changes renamed tests that didn't require code changes to the tests * add types to cleanup test * Test TS Overhaul - Amr, Tiger and myself worked on these commits - Other Raid members in chat assisted - All tests are strongly typed with minimal types to allow for working and made sure tests types were easily usable with types in Pure and Utils file, allow for good UX & DX * Amr updated types useEffect * Jens suggestion for more generic number key type * Remove wait reference from docs * Add nobrayner to contributors * Add JacobMGEvans to contributors * Update src/pure.tsx * Add tigerabrodi to contributors * Add Amr, Juhana, and Jens to contributors * update suspenseHook, cache type and the type of the error in catch. * cleanup.ts, update the way addCleanup adds another callback to cleanupCallbacks. * Made generics more descriptive, made TestHook generic * Remove some eslint disables that didn't do anything * Remove DefinitelyTyped reference in CONTRIBUTING.md * chore: disable declaration for tests * Removes createTimeoutError. Adds constructor to TimeoutError. Adds typeing to waitForValueToChange options * Remove conditional in TestHook for hookProps * Replace old types defs with referenced types in dependencies * Remove destructuring of `testRenderer` * Disabled floating promise lint rule globally * Refactor TestHook catch to not disable lint rules * Disabled eslint error for while(true) * Cleaned up some line warnings from tests * Added "typecheck" kcd-script to improve "validate" script * Clean up ThrowError type in errorHook tests * Replace VoidFunction with () => void * Replace CallableFunction with a more explicit function type Co-authored-by: Braydon Hall <40751395+nobrayner@users.noreply.github.com> Co-authored-by: Amr Gad <merodiro@gmail.com> Co-authored-by: tigerabrodi <tigerabrodi@gmail.com> Co-authored-by: Jacob Evans <cloud887@gmail.com> Co-authored-by: Jacob M-G Evans <27247160+JacobMGEvans@users.noreply.github.com> Co-authored-by: marcosvega91 <marcomoretti0103@gmail.com> Co-authored-by: Michael Peyper <mpeyper7@gmail.com>
- Loading branch information