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

Typescript: Strict compile option for codemods package #23373

Merged

Conversation

aditya1
Copy link
Contributor

@aditya1 aditya1 commented Jul 8, 2023

Migrates @storybook/codemod from #22176

Problem Statement
Packages in StoryBook mono-repo use Typescript. Although, some of them use typescript in non-strict fashion. This PR focuses on codemod package and turns on the strict mode.

What I did

I migrated @storybook/codemod to use strict:true in typescript compiler options. It will enable better type-checking for this package. I've fixed most of the errors which were occurring after changing the strict flag to true. But in some cases, I've used the ts-ignore flag since the code flow was difficult to understand. And as per the issue description, for these PRs changes should not be non-functional, hence I decided to use ts-ignore. Mostly, added ts-ignore at places where function arguments aren't matching.

How to test

For testing, I ran all the existing Unit Tests and E2E Tests. This is a non-functional, non-breaking change running unit tests and E2E tests are sufficient for the testing.

Checklist

  • Make sure your changes are tested (stories and/or unit, integration, or end-to-end tests)
  • Make sure to add/update documentation regarding your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@aditya1 aditya1 requested a review from ndelangen as a code owner July 26, 2023 01:03
@ndelangen ndelangen changed the title Adding tyepscript strict compile option Typescript: strict compile option for codemods package Jul 26, 2023
@ndelangen ndelangen changed the title Typescript: strict compile option for codemods package Typescript: Strict compile option for codemods package Jul 26, 2023
@ndelangen ndelangen merged commit f998cc9 into storybookjs:next Nov 29, 2023
48 of 50 checks passed
@github-actions github-actions bot mentioned this pull request Nov 29, 2023
36 tasks
@github-actions github-actions bot mentioned this pull request Dec 7, 2023
44 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants