clean-codejs-naming

📁 damianwrooby/javascript-clean-code-skills 📅 6 days ago
1
总安装量
1
周安装量
#54001
全站排名
安装命令
npx skills add https://github.com/damianwrooby/javascript-clean-code-skills --skill clean-codejs-naming

Agent 安装分布

amp 1
opencode 1
kimi-cli 1
github-copilot 1
claude-code 1

Skill 文档

Clean Code JavaScript – Naming Patterns

Table of Contents

  • Principles
  • Variables
  • Functions
  • Booleans
  • Bad vs Good Examples

Principles

  • Names should reveal intent
  • Avoid abbreviations and mental mapping
  • Use domain language consistently

Variables

// ❌ Bad
const d = 86400000;

// ✅ Good
const MILLISECONDS_PER_DAY = 86400000;

Functions

// ❌ Bad
function getUser(u) {}

// ✅ Good
function fetchUserById(userId) {}

Booleans

// ❌ Bad
if (!user.isNotActive) {}

// ✅ Good
if (user.isActive) {}

Bad vs Good Examples

// ❌ Bad
const data = getData();

// ✅ Good
const usersResponse = fetchUsers();