diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6cc412726d..13dfd4c393 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -99,10 +99,9 @@ By adopting these practices, you can enhance collaboration and facilitate a bett To ensure code quality and consistency, please adhere to the following guidelines: -- Use kebab-case for both file names and folder names. If the file contains a React component, it should be in capital camelCase. -- Folder names should be in plural format, e.g. `SheetTab.tsx`. +- Use kebab-case for both file names and folder names. If the file contains a React component, it should be in PascalCase, e.g. `SheetTab.tsx`. +- Folder names should be in plural format. - Interfaces should be named starting with a capital "I". -- Resolve all ESLint issues that are identified in the code. - Do use conventional type names including .service, .controller, .menu, .command, .mutation, and .operation. Invent additional type names if you must but take care not to create too many. ### Submitting pull requests @@ -156,6 +155,10 @@ With the help of vscode and its rich ecosystem, you could directly debug unit te - Group related methods or properties together. Do not always use blank lines to separate them. - Keep your concepts consistent by naming your variables consistently. +References: + +* [Make your code readable](https://www.notonlycode.org/make-your-code-readable/) + ### New Package Create a new package with our CLI tool: diff --git a/packages/ui/src/services/shortcut/shortcut.service.ts b/packages/ui/src/services/shortcut/shortcut.service.ts index 062c246d6b..c3e29b3668 100644 --- a/packages/ui/src/services/shortcut/shortcut.service.ts +++ b/packages/ui/src/services/shortcut/shortcut.service.ts @@ -28,8 +28,10 @@ import { KeyCodeToChar, MetaKeys } from './keycode'; export interface IShortcutItem

{ /** This should reuse the corresponding command's id. */ id: string; + /** Description of the shortcut. */ description?: string; + /** If two shortcuts have the same binding, the one with higher priority would be check first. */ priority?: number; /** A callback that will be triggered to examine if the shortcut should be invoked. */ preconditions?: (contextService: IContextService) => boolean;