Skip to content

fix(dev-tooling): run path-scoped JS lint through the local binary - #198

Merged
Martin Bens (SpiGAndromeda) merged 6 commits into
mainfrom
fix/dev-tooling-js-tool-local-binary
Oct 27, 2026
Merged

Martin Bens (SpiGAndromeda) merged 6 commits into
mainfrom
fix/dev-tooling-js-tool-local-binary

Conversation

@SpiGAndromeda

@SpiGAndromeda Martin Bens (SpiGAndromeda) commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

The two JS tool servers now route path-scoped ESLint through the package's own binary, and give Jest, Vitest, the build tools and the scope paths one behavior on every call. A path-scoped ESLint call that would have used a global binary is refused. No tool or parameter was removed.

This PR carries no version bump.

  • Administration eslint_check and eslint_fix with paths run the package's own binary through npm exec --no -- eslint instead of the lint:debugging script.
  • That path-scoped run is refused when node_modules/.bin/eslint is missing, because npm exec --no would run a global binary instead.
  • Under a scope, ESLint paths lose only a leading <scope cwd>/, so a plugin's own app/administration or app/storefront segment stays. A scope cwd written with a leading ./ or a trailing / is stripped the same way, a ./-prefixed path loses ./<scope cwd>/, and an absolute path loses everything through /<scope cwd>/. A path naming the scope cwd itself maps to ..
  • Scope config paths for ESLint, Stylelint, Prettier and tsc_check are checked for shell-hostile characters and quoted.
  • A scoped Stylelint run without paths reads only the aggregate script's own body for a --config or -c and refuses when it finds one. Before, the check also followed scripts reached through npm run, which is removed.
  • jest_run on both servers always runs the package's unit script. The core unit scripts pass --ci.
  • The jest_run route through jest:base and its fallback notice are removed. ci: true appends --ci, for a plugin package whose unit script lacks it.
  • Because the core unit scripts run in CI mode, the core Administration collects coverage on every run and core Storefront Jest writes no missing snapshot unless updateSnapshots is set.
  • jest_run checks its scope and test-pattern arguments and the unit script before installing dependencies, so a call refused by one of those checks installs nothing.
  • Storefront jest_run refuses a bare components/ test path pattern only under scope shopware. Under a plugin scope, the views/components refusal no longer points at vitest_run.
  • vitest_run accepts only scope shopware or no scope, ignores default_scope, and refuses any plugin scope.
  • vite_build, webpack_build, lint_all, lint_twig and unit_setup ignore default_scope when scope is omitted. When one of these tools, tsc_check or vitest_run refuses missing dependencies under a scope other than the default scope, the refusal names worktree_prepare with the scope the tool ran under. tsc_check keeps using default_scope, because a scope can set its tsc.config, and under a plugin scope it refuses when the package defines no lint:types script.
  • webpack_build drops its hot/watch refusal branch, since the mode enum accepts only development and production.
  • Under ddev, path-scoped Stylelint and Prettier runs refuse glob and directory paths on every call, not only on a call targeting a worktree. A path holding a space, a tab or # is accepted, because ddev exec quotes it again.

Docs: plugins/dev-tooling/docs/reference.md, plugins/dev-tooling/README.md and plugins/dev-tooling/AGENTS.md document the ESLint, Stylelint, Jest, Vitest and scope behavior. The scope schema's default_scope description and the session-start scope text name the tools that ignore default_scope.

Path-scoped ESLint runs start the package's own binary through `npm exec --no --` instead of the target-less npm script `lint:debugging`, so the package no longer has to define it. The run is refused when `node_modules/.bin/eslint` is missing, because `npm exec --no` installs nothing but would run a globally installed binary. A scope's Stylelint config is appended on both routes without reading the aggregate script for a config of its own, which removes `js_stylelint_script_passes_config` and its recursion through nested `npm run` bodies. Under a scope, ESLint and app-tree paths lose only a leading `<scope cwd>/`, so a plugin's own `app/administration` or `app/storefront` segment stays. Every scope config path is checked for shell-hostile characters and quoted before it reaches the wrapper. `jest_run` on both servers always runs the `unit` script, which already carries `--ci`, so the fallback route is gone and `ci` is accepted and ignored. Coverage is documented as collected on every core run. Installation and dependency checks moved after the argument refusals, so a refused call installs nothing. `vitest_run` accepts only `shopware`, and the build and aggregate tools ignore `default_scope` because a plugin package defines none of the core scripts. The ddev glob refusal covers every ddev call, not only a call targeting a worktree.

Co-Authored-By: Claude <noreply@anthropic.com>
`reference.md` describes the Administration ESLint `npm exec --no -- eslint` route for `paths` and its refusal when `node_modules/.bin/eslint` is missing. `jest_run` on both servers is documented as always running the package's `unit` script, which passes `--ci` in core, with `ci` accepted and ignored. A scope's Stylelint config is documented as appended without inspecting the aggregate script, and the `ddev` glob and directory refusal as covering every call.

The README and `reference.md` list the tools that ignore `default_scope` when `scope` is omitted, and `vitest_run` refusing plugin scopes. `AGENTS.md` drops the removed Stylelint config detector and the `lint:debugging` route.

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

A scoped Stylelint run without `paths` is refused when the aggregate script's own body already passes `--config` or `-c` to `stylelint`, because the appended scope config cannot apply there. `js_refuse_second_config` reads only that body, not scripts it reaches through `npm run`. `jest_run` appends `--ci` again when `ci` is true, since a plugin package's `unit` script may lack it, and the `unit` append gate now runs before `_jest_install_if_missing`.

The ESLint path rebase strips a scope `cwd` written with a leading `./` or a trailing `/`. Under `ddev`, a glob or directory path holding a space, a tab, `"` or `#` is no longer refused, because `ddev exec` quotes it again. When a core-only tool refuses missing dependencies under a plugin `default_scope`, the refusal names `worktree_prepare` with scope `"shopware"`. Under a plugin scope, the Storefront `views/components` refusal no longer points at `vitest_run`.

`scope_config_arg_or_refuse` and `resolve_core_scope` in `scope.sh` replace the config guard-and-quote block and the core-scope stanza copied across the JS tools.

Co-Authored-By: Claude <noreply@anthropic.com>
`tsc_check` reads the scope's `tsc.config`, so it resolves the call's scope or `default_scope` again instead of always running the core package. The scope schema description and the session-start scope text name the tools that still ignore `default_scope`: `lint_all`, `lint_twig`, `unit_setup`, `vite_build`, `webpack_build` and `vitest_run`. The `worktree_prepare` hint with scope `"shopware"` is added only when the tool ran in the core package, since an explicit plugin scope runs it in the plugin's package.

`js_rebase_package_path` replaces both ESLint rebase functions. Under a scope it also strips the cwd from a `./`-prefixed or absolute path, and a cwd of `./` or `/` leaves the path unchanged. The ddev glob exemption no longer lists `"`, which `parse_paths_json` already refuses under ddev. `scope_config_flag_or_refuse` replaces the scoped `--config` block at the ESLint and Stylelint call sites, and `vitest_run` uses `resolve_core_scope`.

Co-Authored-By: Claude <noreply@anthropic.com>
Under a scope, `js_rebase_package_path` strips a cwd found inside a path only when the path is absolute, so a relative path that contains the cwd keeps its leading segments. A path naming the cwd itself, `./` and a rebased empty path now map to `.`. `tsc_check` under a plugin scope refuses when the package defines no `lint:types` script and names scope `"shopware"`, instead of letting npm fail with "Missing script".

`scope_core_assert_dependencies` is renamed `scope_assert_dependencies`, and `tsc_check` uses it again. Its hint names `worktree_prepare` with the scope the tool ran under whenever that differs from `default_scope` (or `shopware` when unset), which covers an explicit plugin scope. The Stylelint and Storefront ESLint config refusals no longer suggest scope `"shopware"`, which lints the core package. `vitest_run` resolves `shopware` directly. The schema and session-start text name `ludtwig_check` and `ludtwig_fix`, and the Storefront `paths` descriptions limit the package-prefix form to unscoped runs.

Co-Authored-By: Claude <noreply@anthropic.com>
`tsc_check` under a plugin scope now probes `lint:types` with `npm pkg get` before it runs, so its first npm call no longer shows that the override config reached the worktree call. `lint_all` with an explicit scope runs `npm run lint:all` in the scope directory without a probe.

Co-Authored-By: Claude <noreply@anthropic.com>
@SpiGAndromeda
Martin Bens (SpiGAndromeda) merged commit a54ea53 into main Oct 27, 2026
12 checks passed
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