Instruction file imported from bebiksior/httpworkbench (
.cursor/rules/misc.mdc). Copyright stays with the author.
Miscellaneous Conventions
TypeScript and Code Quality
- Use TypeScript for all files.
- Only use types, not interfaces.
- Do not use
anytype. - Use
undefinedovernull. - Do not add any comments to the code that you generate.
- Don’t cast to
any. - Don’t unnecessarily add
try/catch. - Use
computedfor derived state instead of reactive variables when possible. - Use
knipto remove unused code if making large changes. - When refactoring, avoid creating alias types like this:
export type Options = ScanConfig;
Instead, actually rename the type and fix all occurrences if needed.
Structure, Naming, and Organization
- Follow consistent naming conventions:
- Folders: camelCase (
intercept,replay,httpHistory). - Component folders: PascalCase (
PassiveFormCreate,PassiveTable). - All other files: camelCase (
useForm.ts,assistant.graphql).
- Folders: camelCase (
- Avoid massive template blocks; compose smaller components.
- Colocate code that changes together.
- Declare variables close to their usage:
- Avoid declaring all variables at the top of functions/files.
- Place variable declarations as close as possible to where they are first used.
- Group related variables together (e.g., event bus declarations next to their corresponding listeners).
Simplicity and Readability
- Only create an abstraction if it is actually needed.
- Prefer clear function and variable names over inline comments.
- Avoid helper functions when a simple inline expression would suffice.
- Use built-in Tailwind values, occasionally allow dynamic values, rarely globals.