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

Linting: Jsdoc & Bracket style consistency #28886

Merged
merged 26 commits into from
Aug 15, 2024
Merged

Conversation

ndelangen
Copy link
Member

@ndelangen ndelangen commented Aug 14, 2024

What I did

I added a few more prettier plugins which seemed really useful to me.

Auto formatted jsdoc comments

consistent backets for if-statements etc.

New prettier config:
https://github.com/storybookjs/storybook/blob/norbert/linting-part3/scripts/prettier.config.js#L1-L60

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 76.3 MB 76.3 MB 0 B 1 0%
initSize 169 MB 169 MB 1.41 kB 2.44 0%
diffSize 92.6 MB 92.6 MB 1.41 kB 2.44 0%
buildSize 7.46 MB 7.46 MB 434 B 2.37 0%
buildSbAddonsSize 1.61 MB 1.61 MB 0 B 2.56 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 2.3 MB 2.3 MB 171 B 2.31 0%
buildSbPreviewSize 350 kB 351 kB 263 B -0.92 0.1%
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 4.46 MB 4.46 MB 434 B 2.36 0%
buildPreviewSize 3 MB 3 MB 0 B 2.38 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 26.3s 6.9s -19s -348ms -1.08 -277.7%
generateTime 22.4s 19.7s -2s -653ms -0.22 -13.4%
initTime 19.5s 17.8s -1s -687ms 0.1 -9.5%
buildTime 12.7s 13.4s 766ms 1.15 5.7%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 6.5s 8.1s 1.6s 0.01 20%
devManagerResponsive 4.3s 5.2s 933ms 0.49 17.8%
devManagerHeaderVisible 767ms 821ms 54ms -0.09 6.6%
devManagerIndexVisible 810ms 855ms 45ms -0.09 5.3%
devStoryVisibleUncached 1.2s 1.4s 263ms 0.87 17.9%
devStoryVisible 809ms 854ms 45ms -0.27 5.3%
devAutodocsVisible 642ms 780ms 138ms 0.21 17.7%
devMDXVisible 650ms 693ms 43ms -0.62 6.2%
buildManagerHeaderVisible 650ms 801ms 151ms 0.55 18.9%
buildManagerIndexVisible 657ms 810ms 153ms 0.6 18.9%
buildStoryVisible 712ms 842ms 130ms 0.49 15.4%
buildAutodocsVisible 714ms 670ms -44ms -0.38 -6.6%
buildMDXVisible 586ms 654ms 68ms -0.17 10.4%

Greptile Summary

This PR focuses on improving code style, formatting, and documentation across multiple files in the Storybook project, with an emphasis on JSDoc comments and consistent bracket usage.

  • Added curly braces to single-line if statements for improved consistency and readability in multiple files (e.g., code/addons/a11y/src/components/A11yContext.tsx, code/addons/controls/src/manager.tsx)
  • Reformatted and condensed JSDoc comments for better readability in various files (e.g., code/builders/builder-vite/src/utils/process-preview-annotation.ts, code/core/src/common/js-package-manager/JsPackageManager.ts)
  • Improved error handling in code/core/src/core-server/utils/doTelemetry.ts by adding a nested if statement to check if the caught error is an instance of Error
  • Enhanced code consistency and maintainability in code/core/src/csf-tools/CsfFile.ts with improved error handling and formatting
  • Updated code/addons/actions/src/runtime/action.ts to include logic for handling implicit actions during rendering with new error handling for deprecated behavior

@ndelangen ndelangen self-assigned this Aug 14, 2024
Copy link

nx-cloud bot commented Aug 14, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit c526c52. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 from NxCloud.

@ndelangen ndelangen added build Internal-facing build tooling & test updates ci:normal labels Aug 14, 2024
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

30 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings

code/core/src/core-server/utils/doTelemetry.ts Outdated Show resolved Hide resolved
@ndelangen ndelangen added ci:daily Run the CI jobs that normally run in the daily job. and removed ci:normal labels Aug 15, 2024
@ndelangen ndelangen merged commit 010e68f into next Aug 15, 2024
114 checks passed
@ndelangen ndelangen deleted the norbert/linting-part3 branch August 15, 2024 09:58
@github-actions github-actions bot mentioned this pull request Aug 15, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates ci:daily Run the CI jobs that normally run in the daily job.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant