| name | js-conventions |
| description | ALWAYS use this skill BEFORE writing or modifying ANY JavaScript code (.js, .mjs, .cjs, .jsx files), even for simple scripts. Enforces Airbnb JavaScript Style Guide conventions (AIRBNB- prefix), validates naming conventions, module organization, ES6+ patterns, and more against js-guidelines.txt. This skill is MANDATORY for all JavaScript development. |
| license | MIT |
| metadata | {"author":"veeso","version":"1.0.0","tags":["javascript","conventions","linting","airbnb"]} |
JavaScript Development
This skill automatically enforces JavaScript coding standards and best practices when creating or modifying JavaScript code.
Guidelines
Conventions use the AIRBNB- prefix, derived from the Airbnb JavaScript Style Guide. The full guidelines are in js-guidelines.txt.
Rules are identified by their section number and semantic anchor from the upstream guide (e.g., rule 2.1 with anchor references--prefer-const becomes AIRBNB-2.1). These identifiers are for referencing rules in discussion only.
NEVER write convention identifiers as code comments (e.g., // AIRBNB-2.1 ...). Apply the conventions silently; do not annotate code with the rule that motivated it.
Instructions
CRITICAL: This skill MUST be invoked for ANY JavaScript code operation, including:
- Creating new .js, .mjs, .cjs, or .jsx files (even simple examples)
- Modifying existing JavaScript files (any change, no matter how small)
- Reviewing JavaScript code
- Refactoring JavaScript code
Process:
- Read js-guidelines.txt to understand all compliance requirements
- Before writing/modifying ANY JavaScript code, ensure edits conform to the guidelines
- Use
const by default; use let only when reassignment is needed; never use var (AIRBNB-2.1, 2.2, 2.3)
- Prefer object shorthand, destructuring, template literals, and ES6+ patterns throughout
- Use named
export over default export (AIRBNB-10.6)
- Follow Airbnb naming conventions: camelCase for variables/functions, PascalCase for classes/constructors, UPPER_SNAKE_CASE for exported constants (AIRBNB-23.1 through 23.8)
- Prefer arrow functions for anonymous functions and callbacks (AIRBNB-8.1)
- Use
=== and !== over == and != (AIRBNB-15.1)
- Comments must ALWAYS be written in American English, unless the user explicitly requests a different language
No exceptions: Even for trivial code, guidelines must be followed.
ESLint & Prettier Configs
This skill includes reference configurations aligned with the Airbnb JavaScript Style Guide:
Note: The official eslint-config-airbnb package does not support ESLint 9 flat config. eslint-config-airbnb-extended is the recommended drop-in replacement.
When to provide these configs: If the user asks for ESLint configuration, Prettier configuration, or project setup for a JavaScript project, read and copy these files into their project. Adapt the ESLint config if the user needs React support (uncomment/add React plugins).