writing-javascriptlisted
Install: claude install-skill AleksandarBisevac/claude-plugins
# Writing JavaScript here
There is no bundler, no npm, no TypeScript and no build step. The ordered parts under
`ui/report/` and `ui/panel/` are concatenated by Python into exactly one inline `<script>` per
page. The mechanics of that — ordering, the byte pins, splitting — belong to
`refactoring-the-assembled-ui`. This file is about the code you type.
## Which dialect
**Modern ES, in both — and both surfaces now speak it.** This section used to carry a table
showing `report.js` as strictly ES5 against a modern `panel.js`; that gap was closed, and the
table went on describing it. Re-derive rather than reading a number here:
```bash
for d in report panel; do
printf '%s: var=%s function()=%s\n' "$d" \
"$(grep -rho '\bvar ' plugins/audit/scripts/ui/$d/ | wc -l | tr -d ' ')" \
"$(grep -rho 'function *(' plugins/audit/scripts/ui/$d/ | wc -l | tr -d ' ')"
done
```
Both are at zero `var` and zero `function ()`. What is NOT yet symmetric is JSDoc — the report's
parts carry a block per exported behaviour and the panel's parts carry almost none — and since
this project has no TypeScript, JSDoc is the type system it gets. Types must be specific
(`{HTMLTableRowElement}`, `{(a: string, b: string) => number}`), never `{Object}`; when the type
and the code disagree, fix the CODE.
`let-const` has been Baseline *widely available* since 2019-03-20, and every other modern
construct this code would use is in the same bracket. Check before assuming, though —
`grep '^| let-const '`