1---2name: biome-js-linter3description: Pure JavaScript/ECMAScript linting guidance based on Biome's lint rules, filtered to language-level concerns only. No React, Node.js, JSX, CSS, or framework-specific rules. Use when writing, reviewing, or refactoring vanilla JavaScript to catch bugs, avoid pitfalls, enforce idiomatic style, simplify code, and prevent performance or security issues.4---56# Biome JS Linter — Claude Code Skill78> Pure JavaScript/ECMAScript linting guidance distilled from Biome's rules.9> Framework-free — no React, Node.js, JSX, CSS, or TypeScript type-system rules.10> 257 rules organized by concern, with do/don't code examples.1112## When to Use This Skill1314- Writing or reviewing vanilla JavaScript / ECMAScript code15- Catching language-level bugs before they reach production16- Enforcing consistent JS idioms and style17- Simplifying overly complex code18- Identifying performance anti-patterns in pure JS19- Reviewing code for security issues (eval, secrets)2021## Core Workflow22231. **Identify context** — What kind of JS work? Data processing (load performance, simplification), business logic (bugs, pitfalls), library code (style, all categories)242. **Load references** — Pull in relevant category files from the table below253. **Apply rules** — Use the do/don't examples to guide code or review264. **Cite rules** — Reference the Biome rule name (e.g., `noAccumulatingSpread`) when flagging issues2728## Reference Guide2930| Category | Reference | Rules | Load When |31|----------|-----------|-------|-----------|32| Bugs & Correctness | `references/bugs.md` | 37 | Wrong assignments, unreachable code, broken control flow |33| Pitfalls | `references/pitfalls.md` | 63 | Likely-wrong patterns, dubious comparisons, typos |34| Style & Idioms | `references/style.md` | 49 | Naming, syntax preferences, modern idioms |35| Simplification | `references/simplification.md` | 42 | Redundant wrappers, verbose patterns, over-engineering |36| Performance | `references/performance.md` | 8 | O(n^2) patterns, blocking operations |37| Security | `references/security.md` | 1 | Hardcoded secrets |38| Experimental | `references/experimental.md` | 57 | Biome nursery rules, not yet recommended |3940## Critical Rules (Always Apply)4142The highest-impact pure JS rules — keep these in mind at all times.4344### Bugs — Catch Real Mistakes4546| Don't | Do | Rule |47|-------|-----|------|48| Reassign `const` variables | Use `let` if reassignment needed | `noConstAssign` |49| Leave variables unused | Remove or prefix with `_` | `noUnusedVariables` |50| Write code after `return` | Remove unreachable code | `noUnreachable` |51| Use `new` on `Symbol` or `BigInt` | Call without `new`: `Symbol()`, `BigInt()` | `noInvalidNewBuiltin` |52| Return a value from setters | Setters must not return | `noSetterReturn` |53| Assign in `switch` discriminant | Compute before the `switch` | `noSwitchDeclarations` |5455### Pitfalls — Probably Wrong5657| Don't | Do | Rule |58|-------|-----|------|59| `typeof x === "strnig"` | Use valid type strings | `noInvalidTypeofComparison` |60| `x == null` (loose equality) | `x === null \|\| x === undefined` | `noDoubleEquals` |61| Duplicate object keys | Use unique keys | `noDuplicateObjectKeys` |62| `debugger` in committed code | Remove before committing | `noDebugger` |63| Assign inside expressions | Separate assignment from condition | `noAssignInExpressions` |64| Confusing `void` expressions | Separate into two statements | `noConfusingVoidExpression` |6566### Style — Write Idiomatic JS6768| Don't | Do | Rule |69|-------|-----|------|70| `var x = 1` | `const x = 1` or `let x = 1` | `noVar` |71| `x === -0` | `Object.is(x, -0)` | `noCompareNegZero` |72| `new Object()` / `new Array()` | `{}` / `[]` | `noNewSymbol` |73| Comma operator `(a, b)` | Separate statements | `noCommaOperator` |74| `arguments` keyword | Use rest parameters `...args` | `noArguments` |7576### Performance — Avoid Slowdowns7778| Don't | Do | Rule |79|-------|-----|------|80| `[...acc, val]` in `.reduce()` | `acc.push(val); return acc` | `noAccumulatingSpread` |81| `delete obj.key` | `obj.key = undefined` or restructure | `noDelete` |82| `for...in` on arrays | `for...of` or `.forEach()` | `noForEach` |8384### Security8586| Don't | Do | Rule |87|-------|-----|------|88| `const key = "AKIA1234..."` | Use environment variables | `noSecrets` |8990## Constraints9192### MUST DO93- Reference the specific Biome rule name when flagging issues94- Prioritize recommended rules (enabled by default) over optional ones95- Load category reference files for detailed examples before reviewing96- Consider that some rules may be intentionally disabled in the project's biome.json9798### MUST NOT DO99- Apply experimental/nursery rules as errors — they may change100- Include React, Node.js, JSX, CSS, or framework-specific guidance (use `biome-web-linter` for that)101- Override project-specific rule configurations without discussion