Skip to content

Commit 52c46a2

Browse files
ericyangpanclaude
andcommitted
chore: enhance lint workflow and fix code quality issues
- Fix unused variables in i18n sync script and metadata generator - Upgrade noUnusedVariables from warning to error in biome config - Add verification step to lint-staged for stricter checks - Add full project check (npm run check) to pre-commit hook - Add language dictionaries for cspell (es-es, fr-fr, pt-pt, ru_ru) This ensures all commits pass npm run check, preventing code quality regressions from being committed. The pre-commit hook now runs both lint-staged (for quick fixes on changed files) and npm run check (for full project validation). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e1b1b88 commit 52c46a2

File tree

7 files changed

+135
-90
lines changed

7 files changed

+135
-90
lines changed

.claude/skills/i18n/scripts/sync.mjs

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -55,54 +55,6 @@ function getAllKeys(obj, prefix = '') {
5555
return keys
5656
}
5757

58-
/**
59-
* Get value from nested object using dot notation
60-
* @param {Object} obj - The object to query
61-
* @param {string} path - Dot notation path (e.g., 'pages.home.title')
62-
* @returns {*} The value at the path
63-
*/
64-
function getValueByPath(obj, path) {
65-
return path.split('.').reduce((current, key) => current?.[key], obj)
66-
}
67-
68-
/**
69-
* Set value in nested object using dot notation
70-
* @param {Object} obj - The object to modify
71-
* @param {string} path - Dot notation path
72-
* @param {*} value - Value to set
73-
*/
74-
function setValueByPath(obj, path, value) {
75-
const keys = path.split('.')
76-
const lastKey = keys.pop()
77-
const target = keys.reduce((current, key) => {
78-
if (!(key in current)) {
79-
current[key] = {}
80-
}
81-
return current[key]
82-
}, obj)
83-
target[lastKey] = value
84-
}
85-
86-
/**
87-
* Delete value from nested object using dot notation
88-
* @param {Object} obj - The object to modify
89-
* @param {string} path - Dot notation path
90-
*/
91-
function deleteValueByPath(obj, path) {
92-
const keys = path.split('.')
93-
const lastKey = keys.pop()
94-
const target = keys.reduce((current, key) => current?.[key], obj)
95-
96-
if (target && lastKey in target) {
97-
delete target[lastKey]
98-
99-
// Clean up empty parent objects
100-
if (Object.keys(target).length === 0 && keys.length > 0) {
101-
deleteValueByPath(obj, keys.join('.'))
102-
}
103-
}
104-
}
105-
10658
/**
10759
* Recursively rebuild object with same structure and order as reference
10860
* @param {Object} reference - The reference object (en.json)

.husky/pre-commit

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
npx lint-staged
2+
npm run check

biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"correctness": {
3737
"useExhaustiveDependencies": "warn",
38-
"noUnusedVariables": "warn",
38+
"noUnusedVariables": "error",
3939
"noUndeclaredVariables": "error"
4040
},
4141
"performance": {

cspell.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,18 @@
2020
"CLIs",
2121
"cmdk",
2222
"Entwicklungsworkflows",
23-
"Español",
24-
"Français",
2523
"hrefs",
2624
"Integrationen",
2725
"Junie",
2826
"Kimi",
2927
"Kiro",
3028
"Kode",
3129
"Neovate",
32-
"Português",
3330
"Qoder",
3431
"QoderCLI",
3532
"Qwen",
3633
"RLHF",
3734
"Roo",
38-
"Русский",
3935
"shareAI",
4036
"TRAE"
4137
],

0 commit comments

Comments
 (0)