javascript-human-made
Human Made JavaScript Standards
Modern JavaScript (ES6+)
- Prefer
constoverlet; never usevar - Use arrow functions for callbacks and context binding
- Use destructuring and spread operators
- Prefer functional programming (
.map(),.filter(),.reduce()) over imperative loops - Use template literals for string interpolation
- Use async/await over raw Promises where possible
Code Conventions
- Trailing commas in multi-line arrays and objects
- Semicolons end every statement
- Avoid Yoda conditions
- One class per file with
export default - Use named exports for utilities and helpers
Examples
Prefer
const { name, email } = user;
const items = data.map( item => item.id );
const filtered = items.filter( id => id > 0 );
Avoid
var name = user.name;
var email = user.email;
var items = [];
for ( var i = 0; i < data.length; i++ ) {
items.push( data[i].id );
}
Module Organization
- Group imports: external dependencies first, then internal modules
- Keep files focused on a single responsibility
- Export types and interfaces alongside implementations
Linting
Projects use ESLint with WordPress rules:
- Config file:
.eslintrc.js,.eslintrc.json, oreslint.config.js - Run with:
npm run lintornpx eslint .
WordPress Integration
When working with WordPress block editor or admin:
- Use
@wordpress/*packages from npm - Follow WordPress data store patterns for state management
- Use
wp.i18nfunctions for internationalization:__(),_x(),sprintf()
More from humanmade/claude-code-standards
css-scss-human-made
Human Made CSS and SCSS standards. Apply when writing styles, reviewing CSS/SCSS, or working on theme styling. Covers BEM naming, CSS custom properties, theme.json integration, and Stylelint configuration.
20react-human-made
Human Made React component standards. Apply when writing React components, reviewing React code, or building WordPress block editor interfaces. Covers functional components, hooks, PropTypes, and component organization.
1php-human-made
Human Made PHP coding standards for WordPress development. Apply when writing PHP, reviewing PHP code, or working on WordPress plugins and themes. Covers PHPCS HM-Minimum ruleset, namespacing conventions, bootstrap patterns, type hints, and file organization.
1run-linters
Discover and run code linters for the current project. Use when asked to lint code, check code quality, run static analysis, or after completing a feature. Detects PHPCS, PHPStan, ESLint, and Stylelint configurations and runs appropriate checks.
1hm-coding-philosophy
Human Made engineering principles and code quality standards. Apply when writing code, reviewing code, planning implementations, or discussing architecture. Covers code quality priorities, simplicity over complexity, and avoiding over-engineering.
1