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

Convert to typescript #437

Merged
merged 81 commits into from
Jan 31, 2022
Merged

Convert to typescript #437

merged 81 commits into from
Jan 31, 2022

Conversation

jlvandenhout
Copy link
Collaborator

@jlvandenhout jlvandenhout commented Jan 15, 2022

Description of change

As Docusaurus is built on TypeScript and we require some type safety in passing objects around through React components, we might as well add type safety using TypeScript.

TODO:

  • Resolve TS warnings currently marked with @ts-ignore.
  • Resolve TS warnings currently marked with @ts-expect-error.
  • Remove React prop types.
  • Resolve ESLint errors.
  • Resolve ESLint warnings.
  • Run Prettier and resolve any issues.
  • Wait for Migrate to yarn v2 #443 and resolve any conflicts.

Type of change

Choose a type of change, and delete any options that are not relevant.

  • Enhancement (a non-breaking change which adds functionality)

@jlvandenhout jlvandenhout marked this pull request as ready for review January 31, 2022 19:09
Copy link
Collaborator

@Dr-Electron Dr-Electron left a comment

Choose a reason for hiding this comment

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

LGTM

@jlvandenhout jlvandenhout merged commit da09e9d into main Jan 31, 2022
@Dr-Electron Dr-Electron deleted the convert-to-typescript branch March 31, 2022 06:59
Dr-Electron added a commit that referenced this pull request Feb 18, 2023
* Add TypeScript packages and config

* Fix indentation

* Add recommended type annotations

* Configure type checking properly

* Fix according Docusaurus team

* Add packages

* Install migration tool

* [ts-migrate][iota-wiki] Rename files from JS/JSX to TS/TSX

Co-authored-by: ts-migrate <>

* [ts-migrate][iota-wiki] Run TS Migrate

Co-authored-by: ts-migrate <>

* Rename Docusaurus config to JavaScript file according docs

* Remove comments to avoid Docusaurus build fail

* Reference TypeScript sidebars

* Remove PropType checking

* Remove PropType checking

* Remove redundant comment

* Add type

* Allow JSON imports

* Fix relative import

* Use relative paths for now

* Swizzle BlogPostItem as TypeScript

* Swizzle EditThisPage as TypeScript

* Swizzle Footer as TypeScript

* Swizzle MDXComponents as TypeScript

* Swizzle Navbar as TypeScript

* Swizzle DefaultNavbarItem as TypeScript

* Swizzle DropdownNavbarItem as TypeScript

* Swizzle NavbarItem as TypeScript

* Swizzle Toggle as TypeScript

* Add url to frontmatter type

* Use correct type

* Add @ts-ignore rules to fix later

* Re add style

* Fix formatting

* Remove external link icons from footer

* Remove TypeScript migration tool

* Extend MDX with image tag

* Extend NavLink properties

* Extend DropdownNavbarItemProps with check for dropdown

* Update navbar items

* Remove ignore rule

* Fix context signature full screen image provider

* Remove prop types related rules

* Only put shadowed components in the theme folder and the rest in components as recommended by Docusaurus

* Add NodeRequire types

* Fix autoplay setting

* Swizzle SearchBar as TypeScript

* Search is not typed yet so just ignore for now

* Type the HomeLayout and cards properly

* Remove relative import

* Type socials properly

* Remove prop types

* Update packages

* Fix iteration issue

* Fix eslint card props type errors

* Fix FullscreenImage eslint errors

* Fix HomeLayout eslint erros

* Fix Slider eslint errors

* Fix Member eslint errors

* Fix mega dropdown eslint errors

* Fix navbar type eslint errors

* Fix Root eslint errors

* Fix display name errors

* Resolve Typescript errors

* Swizzle Navbar as typescript

* Change hook import

* Resolve unused vars and non null warnings

* Resolve unused vars warnings

* Resolve non null and unused vars warnings

* Resolve explicit any and unused vars warnings

* Resolve non null assertion warnings

* Swizzle searchbar component as typescript

* Update editor

* Fix dropdown type check bug

* Format source code

* Correct image slider imports

* Use published package for the editor

* Fix headers

* Fix image bug

* Update to Docusaurus beta.15

Co-authored-by: Dr-Electron <dr-electr0n@protonmail.com>
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.

3 participants