Skip to content

Allow passing an env var for the strict mode ignore comment #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Eric162
Copy link

@Eric162 Eric162 commented Jul 24, 2025

Added the explanation to the readme:

You can customize the ignore comment used by the plugin through the TS_STRICT_IGNORE_COMMENT
environment variable. This is particularly useful for teams migrating to strict mode who want
different behavior between their development environment and CI pipeline.

Example:

// @ts-strict-cli-ignore
const str: string | null = null;
const len = str.length; // error in IDE, passes cli with proper env var

in package.json scripts:

{
  "scripts": {
    "typecheck": "tsc && TS_STRICT_IGNORE_COMMENT=@ts-strict-ci-ignore tsc-strict"
  }
}
  • Files marked with e.g @ts-strict-cli-ignore will be ignored only by the CLI tool in CI
  • This allows gradual migration where developers see and fix issues locally without breaking the
    build

Have this running in my company repo through patch-package and it is working great!

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