Code Linter Skill
This skill ensures all code meets the project's strict quality standards before it is committed.
🛠️ Tools
- ESLint: configured in
.eslintrc.cjs(oreslint.config.js) - Command:
npm run lint
📋 usage
ALWAYS run this skill:
- After modifying any
.jsxor.jsfile. - Before submitting a task for review.
🚨 Common Fixes
1. no-unused-vars
Error: warning 'X' is defined but never used
Fix:
- If truly unused: DELETE IT.
- If needed for future (rare): Prefix with
_, e.g.,_props.eslintconfig allows_prefix.
2. react-hooks/exhaustive-deps
Error: React Hook useEffect has a missing dependency
Fix:
- Do NOT disable the rule.
- Add the dependency to the array.
- If adding the dependency causes a loop, use
useReforuseCallbackto stabilize the value.
3. Console Logs
Error: no-console or manual observation of noise.
Fix: Remove all console.log statements. Use console.error only for genuine try/catch blocks.
🚀 Execution Steps
- Run
npm run lint. - If errors exist, fix them.
- If warnings exist (like unused vars), fix them. Zero warnings policy.
- Re-run
npm run lintto verify.
Source: gkrishna247/design-portfolio — distributed by TomeVault.