Skip to content

chore: lint and type-check the package in CI - #23

Merged
Karnaukhov-kh merged 1 commit into
mainfrom
chore/lint
Oct 20, 2026
Merged

Karnaukhov-kh merged 1 commit into
mainfrom
chore/lint

Conversation

@Karnaukhov-kh

Copy link
Copy Markdown
Member

The repository had no linter, and nothing type-checked the tests or the shipped hooks.mts examples: the build excludes them, and node --test strips types without checking them.

This PR makes the following changes:

  • Adds ESLint 10.13.0 with the recommended @eslint/js and typescript-eslint 8.72.0 presets in packages/iterward/eslint.config.js. The config lints all .ts, .mts, and .js files outside dist/.
  • Adds lint and typecheck scripts to the package, and npm run lint at the root, which runs both.
  • Runs nx affected -t lint typecheck build test in CI.
  • Fixes the findings: removes 2 unused imports in engine/run.spec.ts, attaches { cause: e } to 3 rethrown errors in load-config.ts and answer-questions.ts, and writes {2} for 2 spaces in a test regex. Error messages stay the same.

The config relaxes 3 rules, each with a comment:

  • no-explicit-any is off, because the engine reads loop, run, and hook JSON as any in 51 places on purpose.
  • no-empty allows an empty catch {}, which marks a failure that the code ignores on purpose.
  • no-unused-vars ignores rest siblings, so const { drops: _, ...edge } = x can drop a key.

The type-aware typescript-eslint presets report 650 findings, mostly no-unsafe-* in tests, so this PR leaves them off.

Add ESLint 10 with the recommended typescript-eslint preset, and a
typecheck target that runs tsc on the whole package. The build skips
the tests and examples and node --test strips types, so nothing
type-checked them before. CI runs both targets for affected projects.

Fix what the linter reports: drop 2 unused test imports, attach the
caught error as the cause of 3 rethrown errors, and count the spaces
in one test regex.
@Karnaukhov-kh
Karnaukhov-kh merged commit 913a5e9 into main Oct 20, 2026
1 check 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