clean-codejs-objects
1
总安装量
1
周安装量
#43263
全站排名
安装命令
npx skills add https://github.com/damianwrooby/javascript-clean-code-skills --skill clean-codejs-objects
Agent 安装分布
amp
1
opencode
1
kimi-cli
1
github-copilot
1
claude-code
1
Skill 文档
Clean Code JavaScript â Object & Class Patterns
Table of Contents
- Encapsulation
- Immutability
- Cohesion
Encapsulation
// â Bad
user.name = 'John';
// â
Good
user.rename('John');
Immutability
// â Bad
user.age++;
// â
Good
const updatedUser = user.withAge(user.age + 1);
Cohesion
// â Bad
class User {
calculateTax() {}
}
// â
Good
class TaxCalculator {
calculate(user) {}
}