JavaScript Coding Practices
Application skill for JavaScript style learning (from the archived awesome-guidelines style capsules). For TypeScript domain rules, load typescript-coding-standards; for React, skills/react-foundation.
Core Principle
JavaScript maintainability is explicit modules and lint-enforced habits, named exports, const-by-default, strict equality, semicolons, no dynamic eval.
When to Use / NOT
.js/.mjs modules, Node/browser scripts, ESLint setup.
- Reviewing import/export boundaries or equality/truthiness bugs.
NOT when:
- TypeScript-only codebase, use
typescript-coding-practices (style) and typescript-coding-standards (domain); still shares many ESLint rules with JS.
- Generated/bundled output, validate source instead.
Workflow
- Modules, named exports, immutable export surface, dedupe imports (
javascript-style-modules-exports.md).
- Bindings,
const/let, ===, explicit empty string/length checks (javascript-style-variables-equality.md).
- Format, 2 spaces, semicolons, braces, trailing commas, switch
default (javascript-style-formatting-control.md).
- Functions, camelCase, arrows in callbacks, JSDoc on exports, ban eval/with/var (
javascript-style-functions-disallowed.md).
- Verify, eslint + formatter on changed paths.
Red Flags
export default without documented project exception
export let mutated externally
var, bare except-style loose equality (== 0)
- Missing semicolon before
(async function IIFE
eval / new String()
Verification
eslint (project config) exit 0 on changed files
- Prettier/clang-format check if configured
- Capsule checklist on review
References
awesome-guidelines/references/javascript-style-learning-note.md
awesome-guidelines/references/javascript-style-modules-exports.md
awesome-guidelines/references/javascript-style-variables-equality.md
awesome-guidelines/references/javascript-style-formatting-control.md
awesome-guidelines/references/javascript-style-functions-disallowed.md
1---2name: javascript-coding-practices3description: Use when authoring or reviewing JavaScript, named ES module exports, const/let, strict equality, semicolons and braces, trailing commas, arrow callbacks, JSDoc on public API, and banned eval/with/var.4---56# JavaScript Coding Practices78Application skill for JavaScript style learning (from the archived `awesome-guidelines` style capsules). For TypeScript domain rules, load `typescript-coding-standards`; for React, `skills/react-foundation`.910## Core Principle1112JavaScript maintainability is **explicit modules and lint-enforced habits**, named exports, const-by-default, strict equality, semicolons, no dynamic eval.1314## When to Use / NOT1516- `.js`/`.mjs` modules, Node/browser scripts, ESLint setup.17- Reviewing import/export boundaries or equality/truthiness bugs.1819**NOT when:**2021- TypeScript-only codebase, use `typescript-coding-practices` (style) and `typescript-coding-standards` (domain); still shares many ESLint rules with JS.22- Generated/bundled output, validate source instead.2324## Workflow25261. **Modules**, named exports, immutable export surface, dedupe imports (`javascript-style-modules-exports.md`).272. **Bindings**, `const`/`let`, `===`, explicit empty string/length checks (`javascript-style-variables-equality.md`).283. **Format**, 2 spaces, semicolons, braces, trailing commas, switch `default` (`javascript-style-formatting-control.md`).294. **Functions**, camelCase, arrows in callbacks, JSDoc on exports, ban eval/with/var (`javascript-style-functions-disallowed.md`).305. **Verify**, eslint + formatter on changed paths.3132## Red Flags3334- `export default` without documented project exception35- `export let` mutated externally36- `var`, bare `except`-style loose equality (`== 0`)37- Missing semicolon before `(async function` IIFE38- `eval` / `new String()`3940## Verification4142- `eslint` (project config) exit 0 on changed files43- Prettier/clang-format check if configured44- Capsule checklist on review454647## References4849- `awesome-guidelines/references/javascript-style-learning-note.md`50- `awesome-guidelines/references/javascript-style-modules-exports.md`51- `awesome-guidelines/references/javascript-style-variables-equality.md`52- `awesome-guidelines/references/javascript-style-formatting-control.md`53- `awesome-guidelines/references/javascript-style-functions-disallowed.md`