From 7c5dd0ab8a1d0c31462e22074835c0a3a763beb9 Mon Sep 17 00:00:00 2001 From: Naoki Oketani Date: Sat, 3 May 2025 04:19:28 +0000 Subject: [PATCH] docs(clinerules): update TypeScript config and code formatting rules --- .clinerules/rules.md | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.clinerules/rules.md b/.clinerules/rules.md index 7b6691e..48ea65f 100644 --- a/.clinerules/rules.md +++ b/.clinerules/rules.md @@ -9,15 +9,24 @@ This document outlines the development guidelines and best practices for our Typ - **TypeScript Configuration** - Use `strict: true` in tsconfig.json to enable all strict type checking options - Enable `esModuleInterop` for better interoperability between CommonJS and ES Modules - - Set `target` to ES6 or higher for modern JavaScript features + - Set `target` to ES2020 for modern JavaScript features + - Use `module: NodeNext` for the latest Node.js module resolution - Use `noImplicitAny: true` to ensure all types are explicitly defined - - Configure `outDir` and `rootDir` to control the output directory structure + - Configure `outDir: "./lib"` and `rootDir: "./src"` to control the output directory structure - **Code Formatting** - - Use Prettier for consistent code formatting + - Use Prettier for consistent code formatting with the following settings: + - 2-space indentation (`tabWidth: 2`) + - No semicolons (`semi: false`) + - Single quotes (`singleQuote: true`) + - No trailing commas (`trailingComma: "none"`) + - No spaces inside brackets (`bracketSpacing: false`) + - Avoid parentheses around single arrow function parameters (`arrowParens: "avoid"`) - Configure ESLint with TypeScript parser for static code analysis - - Enforce consistent naming conventions (camelCase for variables/functions, PascalCase for classes/interfaces) - - Use 2-space indentation for all files + - Enforce consistent naming conventions: + - camelCase for variables and functions + - PascalCase for classes, interfaces, and type aliases + - UPPER_CASE allowed for constants - Run `npm run format` to automatically format all TypeScript files according to project standards - Ensure code formatting is checked in CI with `npm run format-check` @@ -73,7 +82,7 @@ This document outlines the development guidelines and best practices for our Typ - Reference related issues using GitHub keywords (Fixes #123, Closes #456) - Use the GitHub CLI (`gh` command) to create pull requests: ```bash - gh pr create --title "Your PR title" --body "Detailed description" --base main + gh pr create --title 'Your PR title' --body 'Detailed description' --base main ``` ## Code Review