typescript-strict-plugin
typescript-strict-plugin copied to clipboard
Allow passing an env var for the strict mode ignore comment
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-ignorewill 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!