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

perf: added menu config ts type #246

Merged
merged 5 commits into from
Oct 12, 2024
Merged

perf: added menu config ts type #246

merged 5 commits into from
Oct 12, 2024

Conversation

cycleccc
Copy link
Owner

@cycleccc cycleccc commented Oct 11, 2024

Changes Overview

Implementation Approach

Testing Done

Verification Steps

Additional Notes

Checklist

  • I have created a changeset for this PR if necessary.
  • My changes do not break the library.
  • I have added tests where applicable.
  • I have followed the project guidelines.
  • I have fixed any lint issues.

Related Issues

Summary by CodeRabbit

  • New Features

    • Introduced TypeScript type definitions for menu configurations, enhancing type safety and developer experience.
    • Added new interfaces for various menu configurations, improving clarity and usability.
  • Bug Fixes

    • Updated method signatures for improved type assertions and internal logic, ensuring better functionality.
  • Documentation

    • Enhanced documentation to reflect the new type definitions and interfaces for clearer guidance.

Copy link

changeset-bot bot commented Oct 11, 2024

🦋 Changeset detected

Latest commit: a06b224

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
@wangeditor-next/basic-modules Patch
@wangeditor-next/core Patch
@wangeditor-next/editor Patch
@wangeditor-next/upload-image-module Patch
@wangeditor-next/code-highlight Patch
@wangeditor-next/list-module Patch
@wangeditor-next/table-module Patch
@wangeditor-next/video-module Patch
@wangeditor-next/yjs-for-react Patch
@wangeditor-next/yjs Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

coderabbitai bot commented Oct 11, 2024

Walkthrough

The changes introduce TypeScript type definitions to enhance type safety and developer experience in the Wangeditor project. This update affects three packages: @wangeditor-next/basic-modules, @wangeditor-next/core, and @wangeditor-next/editor. Several method signatures and interfaces have been modified or added to improve clarity and type safety, including updates to the genEditorConfig, registerMenu, and getMenuConfig methods, among others.

Changes

File Path Change Summary
packages/basic-modules/src/modules/image/helper.ts Updated method signature for updateImageNode with type assertion added in the function body.
packages/basic-modules/src/modules/link/menu/config.ts Updated method signature for checkLink with parameter name changes.
packages/core/src/config/index.ts Updated method signature for genEditorConfig and modified internal logic; variable type changed.
packages/core/src/config/interface.ts Updated property type for MENU_CONF in IEditorConfig interface.
packages/core/src/menus/register.ts Updated method signature for registerMenu with customConfig type changed.
packages/editor/src/Boot.ts Updated static method signature for registerMenu with customConfig type changed.
packages/core/src/editor/interface.ts Added type alias getMenuConfigReturnType<K> and updated getMenuConfig method signature.
packages/core/src/menus/interface.ts Updated property type for config in IRegisterMenuConf interface.
Various files in packages/core/src/menus Added multiple new interfaces for configuration, including IColorConfig, IFontSizeConfig, etc.

Poem

🐰 In the land of code where rabbits play,
TypeScript types have come to stay.
With clearer paths and safer calls,
Our editor dances, avoiding falls.
Hooray for types, let’s hop with glee,
A brighter future for you and me! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (7)
packages/core/src/config/register.ts (1)

17-17: Good improvement in code clarity.

Adding braces to the if statement enhances readability and reduces the risk of future errors when modifying this code. The logic remains unchanged, which is good.

For consistency with TypeScript best practices, consider using a more explicit null check:

-if (config == null) { return }
+if (config === null || config === undefined) { return }

This change makes the null check more explicit and aligns with TypeScript's strict null checking feature.

packages/core/src/editor/plugins/with-config.ts (1)

18-20: LGTM: Improved for...in loop implementation.

The change from let to const for the loop variable is a good practice. The ESLint disable comment indicates that the lack of a guard in the for...in loop is intentional.

Consider adding a comment explaining why the guard-for-in rule is disabled here, to provide context for future maintainers.

packages/editor/src/Boot.ts (3)

10-14: LGTM! Consider grouping related imports.

The new imports enhance type safety for HTML parsing and generation. The reordering improves readability. However, consider grouping related imports together for better organization.

You could group the HTML-related interfaces together:

import {
  IDomEditor,
  IEditorConfig,
  IElemToHtmlConf,
  IModuleConf,
  IParseElemHtmlConf,
  IPreParseHtmlConf,
  // ... other imports
} from '@wangeditor-next/core'

Also applies to: 19-19, 21-23, 26-31, 33-34


91-92: LGTM! Improved type safety. Consider addressing the TODO comment.

The updated method signature using ISingleMenuConfig instead of a generic object improves type safety and aligns with the new import. This change enhances the developer experience by providing more specific type information.

Consider addressing the TODO comment about passing configuration during registration. If this feature is now implemented with ISingleMenuConfig, update or remove the comment. If it's still pending, consider creating an issue to track this enhancement.


49-50: Consider addressing static analysis warnings about 'this' usage.

The static analysis tool flags the use of 'this' in static methods. While these warnings are generally valid, in this context, 'this' refers to the class itself, which is a common pattern in TypeScript for accessing static properties within static methods.

To improve code clarity and silence these warnings, you could consider using the class name explicitly:

static setEditorConfig(newConfig: Partial<IEditorConfig> = {}) {
  Boot.editorConfig = {
    ...Boot.editorConfig,
    ...newConfig,
  }
}

Alternatively, if you prefer to keep using 'this' for flexibility, you could add a comment to explain the usage or configure the linter to ignore this specific case.

Also applies to: 58-59, 68-69, 89-90

🧰 Tools
🪛 Biome

[error] 49-49: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 50-50: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)

packages/core/src/config/interface.ts (2)

92-95: Review the necessity of the empty IUploadVideoConfig interface

The IUploadVideoConfig interface currently doesn't add any new properties to IUploadConfig. If there are no additional configurations specific to video uploads, you could use IUploadConfig directly or add new properties if needed.

If the interface is not adding new properties, consider simplifying:

-interface IUploadVideoConfig extends IUploadConfig {
-    // 视频专属配置
-}
+// Removed empty IUploadVideoConfig as it doesn't introduce new properties

Alternatively, if future extensions are anticipated, it's acceptable to keep the interface as is for better code organization and readability.


96-99: Ensure consistency between IUploadVideoConfig and IUploadImageConfig

Unlike IUploadVideoConfig, the IUploadImageConfig interface adds a new optional property base64LimitSize. For consistency, if IUploadVideoConfig might have unique configurations in the future, it's acceptable to retain it. Otherwise, consider aligning both interfaces for consistency.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 1809d35 and a06b224.

📒 Files selected for processing (11)
  • .changeset/spicy-foxes-add.md (1 hunks)
  • packages/basic-modules/src/modules/image/helper.ts (1 hunks)
  • packages/basic-modules/src/modules/link/menu/config.ts (1 hunks)
  • packages/core/src/config/index.ts (2 hunks)
  • packages/core/src/config/interface.ts (3 hunks)
  • packages/core/src/config/register.ts (1 hunks)
  • packages/core/src/editor/interface.ts (2 hunks)
  • packages/core/src/editor/plugins/with-config.ts (2 hunks)
  • packages/core/src/menus/interface.ts (2 hunks)
  • packages/core/src/menus/register.ts (2 hunks)
  • packages/editor/src/Boot.ts (3 hunks)
🧰 Additional context used
🪛 Biome
packages/editor/src/Boot.ts

[error] 49-49: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 50-50: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 58-58: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 59-59: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 68-68: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 69-69: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 89-90: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)

🔇 Additional comments (25)
.changeset/spicy-foxes-add.md (1)

1-7: LGTM! Consider enhancing the commit message.

The changeset file is correctly structured and the patch version bumps are appropriate for adding TypeScript types. However, the commit message could be more descriptive.

Consider expanding the commit message to provide more context. For example:

perf: add TypeScript types for menu configuration

- Improves type safety and developer experience
- Affects basic-modules, core, and editor packages

Could you provide more information about the impact of these changes? For instance:

  • How do these new types improve the developer experience?
  • Are there any potential breaking changes despite the patch version bump?
  • Have you updated the documentation to reflect these new types?
packages/core/src/config/register.ts (2)

9-9: Excellent use of Partial<T> type!

The change from IMenuConfig to Partial<IMenuConfig> for GLOBAL_MENU_CONF is a great improvement. This allows for more flexible menu configurations, as users can now provide only a subset of the menu configuration options. This change enhances customization possibilities while maintaining backward compatibility with existing code.


Line range hint 1-19: Overall, excellent improvements to type safety and code clarity.

The changes in this file enhance the flexibility of menu configurations and improve code readability. These modifications align well with TypeScript best practices and the PR objectives. The use of Partial<IMenuConfig> and the addition of braces to the if statement are particularly commendable. Great job!

packages/core/src/menus/register.ts (1)

6-8: LGTM: Import changes look good

The addition of ISingleMenuConfig import and the reordering of existing imports improve code organization and prepare for the upcoming type changes in the function signature.

packages/core/src/editor/plugins/with-config.ts (4)

7-11: LGTM: Import statements reorganized and new types imported.

The changes in the import statements improve code organization and readability. The new import for getMenuConfigReturnType is necessary for the updated getMenuConfig method signature.


29-30: LGTM: Improved if statement formatting.

The addition of curly braces to the if statement enhances readability and reduces the risk of errors in future modifications. This is a good practice for maintaining consistent code style.


44-45: LGTM: Consistent improvement in if statement formatting.

The addition of curly braces to the if statement in the alert method is consistent with the earlier change in the getConfig method. This enhances readability and maintains a consistent code style throughout the file.


35-37: LGTM: Improved type safety in getMenuConfig method.

The updated method signature with the generic type parameter K extends string and return type getMenuConfigReturnType<K> enhances type safety, aligning with the PR objective of improving TypeScript type definitions.

To ensure this change doesn't break existing code, let's verify its usage across the codebase:

packages/core/src/config/index.ts (4)

7-8: LGTM: Import statement reorganization

The relocation of the forEach import statement improves code organization by grouping similar imports together. This change doesn't affect functionality and enhances readability.


21-21: LGTM: Improved code readability

The addition of an empty line after the destructuring of userConfig enhances code readability by clearly separating logical blocks of code. This is a good practice for maintaining clean and easily understandable code.


Line range hint 1-62: Summary: Approved changes with verification suggestion

The changes in this file improve code organization, flexibility, and readability:

  1. The import statement reorganization enhances code structure.
  2. The type change from IMenuConfig to Partial<IMenuConfig> for newMenuConf allows for more flexible configuration.
  3. The addition of a new line improves code readability.

These changes are approved, but please ensure to verify the usage of newMenuConf throughout the codebase to prevent any potential type mismatches due to the change to Partial<IMenuConfig>.


17-17: Approve type change with verification suggestion

The change from IMenuConfig to Partial<IMenuConfig> for newMenuConf allows for a more flexible configuration structure. This is consistent with the userConfig parameter type and improves the function's flexibility.

To ensure this change doesn't introduce any issues, please verify the usage of newMenuConf in other parts of the codebase. Run the following script to check for any potential type mismatches:

✅ Verification successful

Type change verified successfully

The usage of newMenuConf and IMenuConfig across the codebase is consistent with the change to Partial<IMenuConfig>. No type mismatches were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usage of newMenuConf to ensure type compatibility

# Search for usage of newMenuConf
rg --type typescript -A 5 'newMenuConf'

# Search for IMenuConfig usage to ensure it's not expecting a full implementation
rg --type typescript -A 5 'IMenuConfig'

Length of output: 149


Script:

#!/bin/bash
# Description: Check for usage of newMenuConf to ensure type compatibility

# Search for usage of newMenuConf in TypeScript files
rg 'newMenuConf' --glob '*.ts' --glob '*.tsx' -A 5

# Search for IMenuConfig usage in TypeScript files to ensure it's not expecting a full implementation
rg 'IMenuConfig' --glob '*.ts' --glob '*.tsx' -A 5

Length of output: 4149

packages/core/src/menus/interface.ts (2)

8-8: LGTM: Import statement added for ISingleMenuConfig

The import statement for ISingleMenuConfig has been correctly added. This is necessary for the type change in the IRegisterMenuConf interface and maintains good code organization.


77-77: Improved type safety for config property

The change from { [key: string]: any } to ISingleMenuConfig for the config property type in the IRegisterMenuConf interface enhances type safety and aligns with the PR objective. This modification will provide better IntelliSense support and catch potential type-related errors at compile-time.

To ensure this change doesn't break existing implementations, please run the following script to check for any usage of IRegisterMenuConf that might need updating:

Review the output to ensure all usages of IRegisterMenuConf and registerMenu are compatible with the new ISingleMenuConfig type.

✅ Verification successful

Verification Successful

All usages of IRegisterMenuConf have been updated to use ISingleMenuConfig, ensuring enhanced type safety and consistency across the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find usages of IRegisterMenuConf and check if they need updating

# Search for IRegisterMenuConf usage
echo "Searching for IRegisterMenuConf usage:"
rg --type typescript "IRegisterMenuConf" -C 3

# Search for registerMenu function calls, which likely use this interface
echo "\nSearching for registerMenu function calls:"
rg --type typescript "registerMenu\(" -C 3

Length of output: 346


Script:

#!/bin/bash
# Description: Find usages of IRegisterMenuConf and check if they need updating

# Search for IRegisterMenuConf usage in .ts and .tsx files
echo "Searching for IRegisterMenuConf usage in TypeScript files:"
rg "IRegisterMenuConf" --type-add 'ts=*.ts' --type-add 'tsx=*.tsx' -t ts -t tsx -C 3

# Search for registerMenu function calls in .ts and .tsx files
echo "\nSearching for registerMenu function calls in TypeScript files:"
rg "registerMenu\(" --type-add 'ts=*.ts' --type-add 'tsx=*.tsx' -t ts -t tsx -C 3

Length of output: 554


Script:

#!/bin/bash
# Description: Find usages of IRegisterMenuConf and check if they need updating

# Define custom types correctly and search for IRegisterMenuConf usage
echo "Searching for IRegisterMenuConf usage in TypeScript files:"
rg "IRegisterMenuConf" --type-add 'typescript=*.ts,*.tsx' -t typescript -C 3

# Define custom types correctly and search for registerMenu function calls
echo "\nSearching for registerMenu function calls in TypeScript files:"
rg "registerMenu\(" --type-add 'typescript=*.ts,*.tsx' -t typescript -C 3

Length of output: 538


Script:

#!/bin/bash
# Description: Find usages of IRegisterMenuConf and registerMenu in TypeScript files

# Search for IRegisterMenuConf usage in .ts and .tsx files
echo "Searching for IRegisterMenuConf usage in TypeScript files:"
rg "IRegisterMenuConf" -g "*.ts" -g "*.tsx" -C 3

# Search for registerMenu function calls in .ts and .tsx files
echo "\nSearching for registerMenu function calls in TypeScript files:"
rg "registerMenu\(" -g "*.ts" -g "*.tsx" -C 3

Length of output: 6878

packages/core/src/editor/interface.ts (3)

7-13: LGTM: Import statements are well-organized.

The grouping of imports from slate and ../config/interface improves code readability and follows best practices for organizing imports.


19-20: Excellent addition of getMenuConfigReturnType<K> type alias.

This new type alias enhances type safety and flexibility for the getMenuConfig method. It allows for more specific return types based on the menu key, which can improve developer experience and catch potential type-related errors early in development.


31-31: Great improvement to getMenuConfig method signature.

The updated signature for getMenuConfig leverages the new getMenuConfigReturnType<K> type alias, providing enhanced type safety and flexibility. This change allows for more specific return types based on the provided menu key, which can lead to better type inference and fewer runtime errors.

packages/editor/src/Boot.ts (4)

46-46: LGTM! Improved readability.

The added blank lines improve the visual separation between different sections of the class, enhancing readability.

Also applies to: 55-55


63-65: LGTM! Consistent formatting.

The added blank lines for toolbarConfig and simpleToolbarConfig are consistent with the previous changes, further improving the overall readability of the class.

Also applies to: 72-72, 74-74


84-84: LGTM! Consistent formatting maintained.

The added blank line after the plugins declaration maintains the consistent formatting throughout the class.


Line range hint 1-138: Overall, great improvements to type safety and readability!

The changes in this file align well with the PR objectives of enhancing TypeScript type definitions. The introduction of specific interfaces for HTML parsing and generation, along with the use of ISingleMenuConfig, significantly improves type safety. The consistent formatting changes enhance code readability.

A few minor suggestions were made:

  1. Consider grouping related imports for better organization.
  2. Address the TODO comment in the registerMenu method.
  3. Consider addressing the static analysis warnings about 'this' usage in static methods.

These changes provide a solid foundation for improved developer experience and code maintainability.

🧰 Tools
🪛 Biome

[error] 49-49: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 50-50: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 58-58: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 59-59: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 68-68: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 69-69: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)


[error] 77-77: Using this in a static context can be confusing.

this refers to the class.
Unsafe fix: Use the class name instead.

(lint/complexity/noThisInStatic)

packages/basic-modules/src/modules/image/helper.ts (2)

158-158: Approved: Enhanced type safety for onUpdatedImage callback

The addition of the as ImageElement type assertion to imageNode is a good practice. It ensures type safety when passing the node to the onUpdatedImage callback, which can help prevent potential runtime errors and improve code reliability. This change aligns well with TypeScript best practices and the overall goal of improving type definitions in the project.


Line range hint 1-158: Overall assessment: Improved type safety in image helper functions

The change in this file is minimal but effective. It enhances type safety for the updateImageNode function's callback, which is in line with the PR's objective of improving TypeScript type definitions. The rest of the file remains unchanged, maintaining its existing functionality for image-related operations in the editor.

packages/core/src/config/interface.ts (2)

105-173: Improved type safety with explicit definitions in IMenuConfig

Defining explicit properties for each menu item in the IMenuConfig interface enhances type safety and clarity. This change reduces the risk of errors due to misspelled keys and improves the developer experience by providing clear interfaces.


204-204: Flexible menu configuration with Partial<IMenuConfig>

Updating MENU_CONF to be of type Partial<IMenuConfig> allows users to provide only the configurations they need to customize, making the configuration process more flexible and user-friendly.

packages/core/src/menus/register.ts Show resolved Hide resolved
Comment on lines +25 to +26
[key: string]: any;
iconSvg?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Consider specifying more precise types instead of 'any' in ISingleMenuConfig

The use of [key: string]: any; in the ISingleMenuConfig interface reduces type safety and can lead to unintended property assignments without type checking. It's recommended to define specific properties or use a generic type parameter to enhance type safety and provide better code completion and validation.

To enhance type safety, consider removing the index signature or replacing any with a more specific type:

 interface ISingleMenuConfig {
-  [key: string]: any;
   iconSvg?: string;
 }

If dynamic keys are necessary, you might define a generic interface or use a more restrictive index signature.

Committable suggestion was skipped due to low confidence.

@cycleccc cycleccc merged commit eea16b2 into master Oct 12, 2024
2 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Oct 21, 2024
5 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 28, 2024
5 tasks
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.

1 participant