It is not possible to achieve a similar functionality with typescript. You may want to explore whether tslint offers such a feature.
However, it is important to question why this feature is necessary. Why are you excluding lib definitions with --noLib
? TypeScript's role is to ensure that you are correctly utilizing libraries and global libraries through typings. By removing this with --noLib
, you are missing the intended purpose.
Even if you exclude lib definitions, global libs will still be available at runtime. Instead, it is recommended to specify the runtime environment and ECMAScript versions you are targeting with TypeScript to ensure the correct global libraries are accessible to you.
If there are specific behaviors you want to discourage, consider using tslint, as that is not the primary use case for TypeScript.