Skip to content

feat: add javascript, css, and html checker groups - #24

Merged
emersonknapp merged 1 commit into
mainfrom
web-checkers
Sep 10, 2026
Merged

emersonknapp merged 1 commit into
mainfrom
web-checkers

Conversation

@emersonknapp

Copy link
Copy Markdown
Member

Brings the internal polymath web-dev baseline into this package:

  • eslint:recommended
  • typescript-eslint recommended
  • react/react-hooks/jsx-a11y for JSX and TSX
  • eslint-config-prettier last, Prettier with its defaults,
  • stylelint with stylelint-config-standard plus stylelint-config-standard-scss

Node comes from the nodejs-wheel PyPI package, so consuming repos need no system Node and the hooks keep sharing one Python virtualenv.
The npm tools that pip cannot install are pinned in a bundled package-lock.json and installed with npm ci into polymath-node/ under sys.prefix.
That is the pre-commit-managed venv, so the install is per hook revision, shared by every repo on the machine, and never lands in a consuming repo's tree.
A digest stamp skips the reinstall and an flock serializes pre-commit's parallel batches.

Next and Storybook rules are opt-in through a repeatable --framework argument, because rules like @next/next/no-img-element misfire on repos that do not use those frameworks, while polyglot needs them to keep its current coverage.

ESLint is pinned to 9 rather than 10, which is brand new and not fully settled.

Two consumer-environment escapes:

  • Prettier runs with --no-editorconfig, because an .editorconfig in the consuming repo overrides indent and line width even when --config names an absolute file, so [*] indent_size = 4 would silently reformat every CSS, TSX, and HTML file to 4 spaces.
  • And .cjs files, which identify tags as javascript, get @typescript-eslint/no-require-imports turned off, since otherwise no .cjs file can ever pass.

Brings the polyglot root baseline into this package: eslint:recommended,
typescript-eslint recommended, react/react-hooks/jsx-a11y for JSX and TSX,
eslint-config-prettier last, Prettier with its defaults, and stylelint with
stylelint-config-standard plus stylelint-config-standard-scss.

Node comes from the nodejs-wheel PyPI package, so consuming repos need no
system Node and the hooks keep sharing one Python virtualenv. The npm tools
that pip cannot install are pinned in a bundled package-lock.json and
installed with `npm ci` into `polymath-node/` under sys.prefix. That is the
pre-commit-managed venv, so the install is per hook revision, shared by every
repo on the machine, and never lands in a consuming repo's tree. A digest
stamp skips the reinstall and an flock serializes pre-commit's parallel
batches.

Next and Storybook rules are opt-in through a repeatable `--framework`
argument, because rules like @next/next/no-img-element misfire on repos that
do not use those frameworks, while polyglot needs them to keep its current
coverage.

ESLint is pinned to 9 rather than 10: typescript-eslint accepts both, but 10
is weeks old and the plugin ecosystem has not settled. TypeScript stays on
5.9 because typescript-eslint's peer range is <6.1.0.

Two consumer-environment escapes are closed. Prettier runs with
`--no-editorconfig`, because an `.editorconfig` in the consuming repo
overrides indent and line width even when `--config` names an absolute file,
so `[*] indent_size = 4` would silently reformat every CSS, TSX, and HTML
file to 4 spaces. And `.cjs` files, which identify tags as `javascript`, get
`@typescript-eslint/no-require-imports` turned off, since otherwise no `.cjs`
file can ever pass.

Deviations from the plan, both forced by Node's resolution rules:

- `ensure_node_modules()` returns the install directory instead of its
  `node_modules/.bin`. The bundled tool configs are copied in beside the
  manifest, since Node resolves an ESLint config's bare imports and a
  Stylelint config's `extends` by walking up from the config file. Callers
  need both that directory's `.bin` and its configs.
- The install stamp covers the whole bundle, not just the lockfile, so
  editing a tool config reinstalls.
- stylelint.config.mjs keeps the CSS baseline at the root with only the SCSS
  override, because Stylelint rejects a config whose rules live entirely in
  `overrides`.

`npm ci` resolved the pinned versions with no peer conflict, so no pins moved.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Emerson Knapp <emerson@polymathrobotics.com>
@emersonknapp
emersonknapp merged commit b44d0a1 into main Sep 10, 2026
4 checks passed
@emersonknapp
emersonknapp deleted the web-checkers branch September 10, 2026 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant