From 66143eaf74dfc85c7719a41302c6421dfa461bbb Mon Sep 17 00:00:00 2001 From: Jonghyeok Park Date: Tue, 3 Mar 2026 22:01:20 +0900 Subject: [PATCH 1/2] chore: add .prettierrc for consistent code formatting The post-edit-format hook runs Prettier on JS/TS files after edits, but without a project-level config it applied default settings (double quotes, etc.) that conflicted with the existing code style. Adding .prettierrc ensures the hook respects the project conventions. Settings derived from existing codebase analysis: - singleQuote: true - trailingComma: none - arrowParens: avoid - printWidth: 200 --- .prettierrc | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .prettierrc diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 000000000..a8e7ef68e --- /dev/null +++ b/.prettierrc @@ -0,0 +1,8 @@ +{ + "singleQuote": true, + "trailingComma": "none", + "semi": true, + "tabWidth": 2, + "printWidth": 200, + "arrowParens": "avoid" +} From 3260c7449e6e284f12dc7f951057d99049169c2d Mon Sep 17 00:00:00 2001 From: Jonghyeok Park Date: Tue, 3 Mar 2026 22:11:51 +0900 Subject: [PATCH 2/2] fix(lint): remove unnecessary escape characters in regex patterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - doc-file-warning.js: \/ → / inside character classes (4 occurrences) - project-detect.js: \[ → [ inside character classes (2 occurrences) These are pre-existing no-useless-escape errors on upstream main. --- scripts/hooks/doc-file-warning.js | 16 +++++---- scripts/lib/project-detect.js | 57 +++++++++++++++++++------------ 2 files changed, 46 insertions(+), 27 deletions(-) diff --git a/scripts/hooks/doc-file-warning.js b/scripts/hooks/doc-file-warning.js index 497d024ac..f45edc30d 100644 --- a/scripts/hooks/doc-file-warning.js +++ b/scripts/hooks/doc-file-warning.js @@ -5,20 +5,24 @@ */ let data = ''; -process.stdin.on('data', c => data += c); +process.stdin.on('data', c => (data += c)); process.stdin.on('end', () => { try { const input = JSON.parse(data); const filePath = input.tool_input?.file_path || ''; - if (/\.(md|txt)$/.test(filePath) && - !/(README|CLAUDE|AGENTS|CONTRIBUTING|CHANGELOG|LICENSE|SKILL)\.md$/i.test(filePath) && - !/\.claude[\/\\]plans[\/\\]/.test(filePath) && - !/(^|[\/\\])(docs|skills|\.history)[\/\\]/.test(filePath)) { + if ( + /\.(md|txt)$/.test(filePath) && + !/(README|CLAUDE|AGENTS|CONTRIBUTING|CHANGELOG|LICENSE|SKILL)\.md$/i.test(filePath) && + !/\.claude[/\\]plans[/\\]/.test(filePath) && + !/(^|[/\\])(docs|skills|\.history)[/\\]/.test(filePath) + ) { console.error('[Hook] WARNING: Non-standard documentation file detected'); console.error('[Hook] File: ' + filePath); console.error('[Hook] Consider consolidating into README.md or docs/ directory'); } - } catch { /* ignore parse errors */ } + } catch { + /* ignore parse errors */ + } console.log(data); }); diff --git a/scripts/lib/project-detect.js b/scripts/lib/project-detect.js index 9b9bb5b18..cac0f060a 100644 --- a/scripts/lib/project-detect.js +++ b/scripts/lib/project-detect.js @@ -165,10 +165,7 @@ function getPackageJsonDeps(projectDir) { const pkgPath = path.join(projectDir, 'package.json'); if (!fs.existsSync(pkgPath)) return []; const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); - return [ - ...Object.keys(pkg.dependencies || {}), - ...Object.keys(pkg.devDependencies || {}) - ]; + return [...Object.keys(pkg.dependencies || {}), ...Object.keys(pkg.devDependencies || {})]; } catch { return []; } @@ -190,12 +187,17 @@ function getPythonDeps(projectDir) { content.split('\n').forEach(line => { const trimmed = line.trim(); if (trimmed && !trimmed.startsWith('#') && !trimmed.startsWith('-')) { - const name = trimmed.split(/[>== { - const name = m.replace(/"/g, '').split(/[>== 0) { let depList = []; switch (rule.language) { - case 'python': depList = pyDeps; break; + case 'python': + depList = pyDeps; + break; case 'typescript': - case 'javascript': depList = npmDeps; break; - case 'golang': depList = goDeps; break; - case 'rust': depList = rustDeps; break; - case 'php': depList = composerDeps; break; - case 'elixir': depList = elixirDeps; break; + case 'javascript': + depList = npmDeps; + break; + case 'golang': + depList = goDeps; + break; + case 'rust': + depList = rustDeps; + break; + case 'php': + depList = composerDeps; + break; + case 'elixir': + depList = elixirDeps; + break; } - hasDep = rule.packageKeys.some(key => - depList.some(dep => dep.toLowerCase().includes(key.toLowerCase())) - ); + hasDep = rule.packageKeys.some(key => depList.some(dep => dep.toLowerCase().includes(key.toLowerCase()))); } if (hasMarker || hasDep) {