From 6f3f65da16bea8d94a3c97d630bfd38f120a5dc2 Mon Sep 17 00:00:00 2001 From: sorrycc Date: Mon, 10 Feb 2025 14:34:44 +0800 Subject: [PATCH] chore: remove .cursorrules and use .cursor/rules --- .cursorrules => .cursor/rules/general.mdc | 11 ++++++----- .cursor/rules/test.mdc | 8 ++++++++ .cursor/rules/typescript.mdc | 11 +++++++++++ 3 files changed, 25 insertions(+), 5 deletions(-) rename .cursorrules => .cursor/rules/general.mdc (66%) create mode 100644 .cursor/rules/test.mdc create mode 100644 .cursor/rules/typescript.mdc diff --git a/.cursorrules b/.cursor/rules/general.mdc similarity index 66% rename from .cursorrules rename to .cursor/rules/general.mdc index 4d748b6..be7fd6b 100644 --- a/.cursorrules +++ b/.cursor/rules/general.mdc @@ -1,3 +1,7 @@ +--- +description: General Rules +globs: +--- ## General @@ -22,10 +26,7 @@ ## Code Style - Use TypeScript. -- Make sure the created files are ending with a new line at the end of the file. - File names should be in lowercase with dash separators. -- Do not use specifiers for `fs` and `path` modules. -- Do use `pathe` instead of `path` module for windows compatibility. -- Test. 1) Use vitest for test cases, not jest. 2) Test cases should be in the same file as the code that is being tested. e.g. `foo.test.ts` for `foo.ts`. 3) Do use `test()` instead of `describe() + it()` for test cases. -- Use `printWidth: 80, singleQuote: true, trailingComma: all, indent_style: space, indent_width: 2` for code formatting. - Api, commands and config in README.md should be ordered alphabetically. +- Test. 1) Use vitest for test cases, not jest. 2) Test cases should be in the same file as the code that is being tested. e.g. `foo.test.ts` for `foo.ts`. + diff --git a/.cursor/rules/test.mdc b/.cursor/rules/test.mdc new file mode 100644 index 0000000..4f520e6 --- /dev/null +++ b/.cursor/rules/test.mdc @@ -0,0 +1,8 @@ +--- +description: Rules for test files +globs: *.test.ts, *.test.tsx, *.test.js, *.test.jsx +--- + +# Your rule content + +- Do use `test()` instead of `describe() + it()` for test cases. diff --git a/.cursor/rules/typescript.mdc b/.cursor/rules/typescript.mdc new file mode 100644 index 0000000..23c7ca2 --- /dev/null +++ b/.cursor/rules/typescript.mdc @@ -0,0 +1,11 @@ +--- +description: Rules for TypeScript files +globs: *.ts, *.tsx, *.js, *.jsx +--- + +# Your rule content + +- Files are ending with a new line at the end of the file. +- Do not use specifiers for `fs` and `path` modules. +- Do use `pathe` instead of `path` module for windows compatibility. +- Use `printWidth: 80, singleQuote: true, trailingComma: all, indent_style: space, indent_width: 2` for code formatting.