Skip to content

Speed up frontend linting and trim the Linting CI job#14853

Draft
rtibbles wants to merge 4 commits into
learningequality:developfrom
rtibbles:lintspeed
Draft

Speed up frontend linting and trim the Linting CI job#14853
rtibbles wants to merge 4 commits into
learningequality:developfrom
rtibbles:lintspeed

Conversation

@rtibbles

@rtibbles rtibbles commented Jun 12, 2026

Copy link
Copy Markdown
Member

Summary

Speeds up frontend linting, locally and in CI, with three changes:

  • Disable import-x/namespace — it deep-walks every imported module's export graph to validate import * as ns member access, costing ~47% of all ESLint rule time for little value (the webpack build and tests already catch bad namespace access). import-x/named is kept — far cheaper, higher value.
  • Drop the explicit Python/dev-deps install steps in the Linting CI jobuv run prek syncs the dev group and fetches Python on demand, so the separate uv python install and uv sync --group dev (~58s, present only to obtain prek) steps were redundant. The Node toolchain is kept for the hooks that need it.
  • Fix a latent bug in prettierFormat — it returned the prettier.format() promise from inside its try without await, so parse-error rejections escaped the catch.

References

No tracking issue — performance follow-up from profiling the Linting CI job.

Reviewer guidance

  • The workflow change is the risk — check this PR's Linting run passes every hook (especially uv-lock and the python-based hooks, now that the explicit uv sync is gone and uv run prek syncs on demand).
  • Dropping import-x/namespace only removes import * as ns member checks; import-x/named still catches missing named imports.

AI usage

I used Claude Code to profile the linting, identify that import-x/namespace dominated ESLint rule time, and draft these changes. I directed the investigation and the decisions (which rule to drop, dropping the redundant Python/dev-deps install steps), reviewed each diff, and confirmed the lint hook still passes locally.

@github-actions github-actions Bot added DEV: dev-ops Continuous integration & deployment SIZE: small labels Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

npm Package Versions

Merging this PR will publish the following packages to npm:

Package Current New
kolibri-format 2.4.0 2.4.1

@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

rtibbles and others added 4 commits July 7, 2026 11:11
import-x/namespace deep-walks each imported module's export graph to
validate `import * as ns` member access — roughly 47% of all ESLint
rule time, for little value: the webpack build and tests already catch
bad namespace access. import-x/named (validating named imports) is
kept; it is far cheaper and higher value.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
prettierFormat returned the prettier.format() promise from inside its
try block without awaiting it, so a parse-error rejection escaped the
catch and surfaced as an unhandled rejection instead of the intended
"Parsing error during prettier formatting" message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
uv run prek syncs the dev group and fetches Python on demand, so the explicit uv python install and uv sync --group dev steps were unnecessary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DEV: dev-ops Continuous integration & deployment SIZE: small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant