ts-api-utils - v3.0.0-rc.1
    Preparing search index...

    Function isStrictCompilerOptionEnabled

    • Checks if a given compiler option is enabled, accounting for whether all flags (except strictPropertyInitialization) have been enabled by strict: true.

      Parameters

      Returns boolean

      const optionsLenient = {
      noImplicitAny: true,
      };

      isStrictCompilerOptionEnabled(optionsLenient, "noImplicitAny"); // true
      isStrictCompilerOptionEnabled(optionsLenient, "noImplicitThis"); // false
      const optionsStrict = {
      noImplicitThis: false,
      strict: true,
      };

      isStrictCompilerOptionEnabled(optionsStrict, "noImplicitAny"); // true
      isStrictCompilerOptionEnabled(optionsStrict, "noImplicitThis"); // false