Skip to content

CLI: Typescript strict mode#22254

Merged
ndelangen merged 43 commits into
storybookjs:nextfrom
0916dhkim:typefix-cli
Nov 28, 2023
Merged

CLI: Typescript strict mode#22254
ndelangen merged 43 commits into
storybookjs:nextfrom
0916dhkim:typefix-cli

Conversation

@0916dhkim
Copy link
Copy Markdown
Contributor

Part of #22176

What I did

Fix some typescript errors before enabling strict mode.

How to test

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"]


logger.info(`✅ Updating main.js to use vite builder`);
if (!dryRun) {
await updateMainConfig({ dryRun, mainConfigPath }, async (main) => {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

mainConfigPath is declared as optional in RunOptions here

mainConfigPath?: string;

but updateMainConfig expects non-null string. What would be a good fix here?

}

if (!eslintFile && !unsupportedExtension) {
if (!eslintFile || !unsupportedExtension) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm pretty sure this is meant to be || here. Let me know if this is a mistake.

Comment thread code/lib/cli/src/add.ts
Comment on lines -59 to +63
return groups ? [groups[1], groups[2]] : [addon, undefined];
if (groups) {
return [groups[0], groups[2]] as const;
}
return [addon, undefined] as const;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Probably would have just made more sense to add a tuple return-type to the getVersionSpecifier function definition.

@0916dhkim 0916dhkim marked this pull request as ready for review May 20, 2023 21:19
@kasperpeulen kasperpeulen marked this pull request as draft August 4, 2023 09:56
@kasperpeulen kasperpeulen removed their assignment Aug 4, 2023
@ndelangen ndelangen added maintenance User-facing maintenance tasks cli typescript ci:normal labels Nov 28, 2023
@ndelangen ndelangen changed the title CLI: typescript strict mode CLI: Typescript strict mode Nov 28, 2023
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Nov 28, 2023

Updated and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@rollup/pluginutils 5.0.5...5.1.0 None +0/-0 57.1 kB

🚮 Removed packages: @angular-devkit/core@16.2.4, @storybook/client-logger@7.5.3, @storybook/theming@7.5.3

@socket-security
Copy link
Copy Markdown

socket-security Bot commented Nov 28, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

@ndelangen
Copy link
Copy Markdown
Member

@SocketSecurity ignore json-parse-even-better-errors@3.0.0
@SocketSecurity ignore cacache@17.0.6
@SocketSecurity ignore npm-install-checks@6.1.1
@SocketSecurity ignore semver@7.4.0
@SocketSecurity ignore fs-minipass@3.0.2
@SocketSecurity ignore json-stable-stringify@1.0.2
@SocketSecurity ignore url@0.11.0
@SocketSecurity ignore webpack-hot-middleware@2.25.3
@SocketSecurity ignore clone-response@1.0.3
@SocketSecurity ignore responselike@2.0.1
@SocketSecurity ignore danger@11.2.6
@SocketSecurity ignore node-cleanup@2.1.2

@ndelangen ndelangen marked this pull request as ready for review November 28, 2023 23:22
@ndelangen ndelangen merged commit 34a7c05 into storybookjs:next Nov 28, 2023
@github-actions github-actions Bot mentioned this pull request Nov 28, 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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants