web-style
Domain plugin for JavaScript style corpora. Covers naming conventions, variable declarations, function shape, object and array idioms, module layout, and core readability principles drawn from Airbnb and Google style guides.
Atom counts by kind
| Kind | Count |
|---|---|
| rule | 14 |
| anti-pattern | 4 |
| principle | 2 |
Tag vocabulary
Words a brief might contain that signal this domain.
Retrieval axes
Domain-specific dimensions used by Prime's retrieval scoring.
scope · 9 matches
The language surface the rule governs — declarations, names, functions, objects, arrays, modules.
severity · 3 matches
How firmly a style guide enforces the rule — error (always), warning (almost always), suggestion (preference).
language · 6 matches
Which language family the atom applies to. JavaScript-specific atoms apply to TypeScript by inheritance unless otherwise noted.
Sample atoms
Import For Side Effects
Writing `import './polyfills'` or `import 'register-handlers'` to trigger code execution at module load.…
Mutable Named Export
Declaring `export let counter = 0` (or similar) and then reassigning it elsewhere in the module so importers' references update with each change.…
Reassign Parameters
Treating a parameter as a mutable local — assigning to it, mutating its properties when the caller did not opt in, or using it as scratch space.…
Use Var
Using `var` to declare any binding in modern JavaScript or TypeScript. `var` is hoisted to the enclosing function, has no temporal-dead-zone protection, and is silently re-declarable — three properties that exist only be…
Clarity Over Cleverness
When a clever idiom and an obvious idiom both work, pick the obvious one. Save the cleverness for the cases where it earns its keep — performance hot paths backed by benchmarks, language-level constraints that allow no o…
Consistency Within Codebase
Local consistency outranks personal preference. If the existing code uses arrow functions everywhere, the new arrow function is correct even if you would have written `function`. If the codebase imports from `.…
Arrow Functions For Callbacks
When the function is anonymous and passed inline as an argument or assigned to a binding, use an arrow function.…
Camelcase Variables And Functions
Local variables, parameters, function names, methods, and non-static class fields are written in `camelCase` — first word lowercase, every subsequent word capitalised, no underscores or hyphens.…
Default Parameters Not Mutate Args
Express defaults in the parameter list with `=`. Do not patch missing values inside the body with reassignment, `||`, or by writing into `arguments`.…
Descriptive Not Abbreviated Names
Identifier length follows information content. Use whole words that describe the role of the binding.…
Destructure Objects And Arrays
When a function reads more than one property of an object — its parameter, its return value, or any local — pull them out with destructuring.…
Group Const Then Let
Within a scope, list every `const` binding before any `let` binding. The reader can then scan the top of the scope and immediately see which bindings are fixed and which will mutate, without re-checking each line.