fix(ci): resolve lint error and test failures#34
Merged
Conversation
- eslint.config.js: disable base no-unused-vars for TS files; the @typescript-eslint/no-unused-vars rule (with argsIgnorePattern '^_') already handles this correctly. Fixes the _value error in prompts.ts. - src/test-setup.ts: set NO_COLOR=1 before tests run so picocolors strips ANSI codes; GitHub CI sets FORCE_COLOR=1 which caused logger tests to fail on exact string matches that include color prefixes. - jest.config.js: add setupFiles pointing to test-setup.ts. - .github/workflows/ci.yml: add build step before tests in test and coverage jobs; integration tests require dist/index.js to exist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Lint error (
_valueunused variable): The base ESLintno-unused-varsrule fromeslint.configs.recommendedwas flagging_valueparameter names in TypeScript type signatures. Fixed by disabling the base rule for TS files and relying solely on@typescript-eslint/no-unused-vars(which correctly respects theargsIgnorePattern: '^_'option).Test failures in CI (logger, init, integration tests): GitHub Actions sets
FORCE_COLOR=1, causing picocolors to add ANSI escape codes even in non-TTY Jest workers. Tests that checkedlogOutput.includes('[debug] Debug message')failed because the actual string contained ANSI codes. Fixed by adding asetupFilesentry (src/test-setup.ts) that setsprocess.env.NO_COLOR = '1'before any test runs.CLI integration test failures: The test
beforeAllchecks fordist/index.jsand throws if missing. Thetestjob in CI didn't have a build step, so the dist directory never existed. Fixed by addingpnpm run buildbefore the test step in both thetestandcoverageCI jobs.Test plan
pnpm lint— 0 errors (97 warnings only, as expected for a CLI tool using console)pnpm build— clean TypeScript compilationpnpm test— 259/259 tests passFORCE_COLOR=1 pnpm test— 259/259 tests pass (simulating CI environment)🤖 Generated with Claude Code