Repository navigation
chore: lint and type-check the package in CI - #23
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repository had no linter, and nothing type-checked the tests or the shipped
hooks.mtsexamples: the build excludes them, andnode --teststrips types without checking them.This PR makes the following changes:
@eslint/jsand typescript-eslint 8.72.0 presets inpackages/iterward/eslint.config.js. The config lints all.ts,.mts, and.jsfiles outsidedist/.lintandtypecheckscripts to the package, andnpm run lintat the root, which runs both.nx affected -t lint typecheck build testin CI.engine/run.spec.ts, attaches{ cause: e }to 3 rethrown errors inload-config.tsandanswer-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-anyis off, because the engine reads loop, run, and hook JSON asanyin 51 places on purpose.no-emptyallows an emptycatch {}, which marks a failure that the code ignores on purpose.no-unused-varsignores rest siblings, soconst { drops: _, ...edge } = xcan drop a key.The type-aware typescript-eslint presets report 650 findings, mostly
no-unsafe-*in tests, so this PR leaves them off.