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

SHARD-2019 - Prettier lib-types #37

Merged
merged 2 commits into from
Mar 18, 2025
Merged

Conversation

mhanson-github
Copy link

@mhanson-github mhanson-github commented Mar 18, 2025

PR Type

enhancement, formatting


Description

  • Remove semicolons from TypeScript interface definitions

  • Adjust Prettier configuration for print width

  • Reformat import statements for consistency

  • Update test cases to match new formatting


Changes walkthrough 📝

Relevant files
Formatting
13 files
ActiveTypes.ts
Remove semicolons from TypeScript interfaces                         
+11/-11 
ArchiversTypes.ts
Reformat import statements and remove semicolons                 
+2/-9     
CycleCreatorTypes.ts
Remove semicolons from TypeScript interfaces                         
+2/-6     
LostArchiverTypes.ts
Remove semicolons from TypeScript interfaces                         
+22/-22 
LostTypes.ts
Remove semicolons from TypeScript interfaces                         
+32/-32 
NodeListTypes.ts
Reformat type definitions for consistency                               
+2/-7     
P2PTypes.ts
Reformat type definitions for consistency                               
+3/-7     
ServiceQueueTypes.ts
Remove semicolons from TypeScript interfaces                         
+3/-3     
SnapshotTypes.ts
Reformat type definitions for consistency                               
+6/-22   
StateManagerTypes.ts
Remove semicolons from TypeScript interfaces                         
+26/-26 
StateMetaDataTypes.ts
Remove semicolons from TypeScript interfaces                         
+17/-17 
shardFunctionTypes.ts
Reformat export statements for consistency                             
+15/-3   
stringify.ts
Reformat conditional statements for consistency                   
+1/-4     
Tests
1 files
stringify.test.ts
Update test cases to match new formatting                               
+7/-9     
Configuration changes
1 files
prettier.config.js
Adjust Prettier print width configuration                               
+1/-1     

Need help?
  • Type /help how to ... in the comments thread for any questions about PR-Agent usage.
  • Check out the documentation for more information.
  • Copy link

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🏅 Score: 95
    🧪 PR contains tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Issue

    The condition for checking options.bufferEncoding and isBufferValue was refactored. Ensure that the logic remains correct and that no unintended behavior is introduced.

    } else if (options.bufferEncoding !== 'none' && isBufferValue(toStr, val as Record<string, unknown>)) {
      switch (options.bufferEncoding) {
        case 'base64':

    Comment on lines 5 to +7
    type Diff<T, U> = T extends U ? never : T
    type OptionalExceptFor<T, TRequired extends keyof T> = Partial<T> &
    Pick<T, TRequired>
    type RequiredExceptFor<T, TOptional extends keyof T> = Pick<
    T,
    Diff<keyof T, TOptional>
    > &
    Partial<T>
    type OptionalExceptFor<T, TRequired extends keyof T> = Partial<T> & Pick<T, TRequired>
    type RequiredExceptFor<T, TOptional extends keyof T> = Pick<T, Diff<keyof T, TOptional>> & Partial<T>

    Choose a reason for hiding this comment

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

    Suggestion: Ensure that the Diff type utility is correctly defined and handles edge cases where T or U might be never or unknown. [possible issue, importance: 5]

    Suggested change
    type Diff<T, U> = T extends U ? never : T
    type OptionalExceptFor<T, TRequired extends keyof T> = Partial<T> &
    Pick<T, TRequired>
    type RequiredExceptFor<T, TOptional extends keyof T> = Pick<
    T,
    Diff<keyof T, TOptional>
    > &
    Partial<T>
    type OptionalExceptFor<T, TRequired extends keyof T> = Partial<T> & Pick<T, TRequired>
    type RequiredExceptFor<T, TOptional extends keyof T> = Pick<T, Diff<keyof T, TOptional>> & Partial<T>
    type Diff<T, U> = T extends U ? never : T
    type OptionalExceptFor<T, TRequired extends keyof T> = Partial<T> & Pick<T, TRequired>
    type RequiredExceptFor<T, TOptional extends keyof T> = Pick<T, Diff<keyof T, TOptional>> & Partial<T>

    @BelfordZ BelfordZ merged commit 92b6d84 into mainnet-launch Mar 18, 2025
    5 checks passed
    @BelfordZ BelfordZ deleted the SHARD-2019-prettier branch March 18, 2025 19:29
    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.

    2 participants