Skip to main content

Crate use_tsconfig

Crate use_tsconfig 

Source
Expand description

§use-tsconfig

Partial practical tsconfig.json metadata primitives for RustUse.

§Experimental

use-tsconfig is experimental while use-js remains below 0.3.0.

§Example

use use_ts::{TsModuleResolution, TsStrictness, TsTarget};
use use_tsconfig::{CompilerOptions, TsConfig, TsConfigInclude};

let options = CompilerOptions::new()
    .with_target("es2022".parse::<TsTarget>()?)
    .with_module_resolution(TsModuleResolution::Bundler)
    .with_strictness(TsStrictness::Strict);
let config = TsConfig::new().with_compiler_options(options).with_include(TsConfigInclude::new("src")?);

assert_eq!(config.include().len(), 1);

§Scope

  • Intentionally partial tsconfig.json metadata.
  • Common compiler option fields such as target, module resolution, strict, JSX, base URL, and paths.
  • Optional serde derives behind the serde feature.

§Non-goals

  • Full tsconfig schema coverage.
  • JSON parsing.
  • TypeScript compiler behavior or validation parity.

§License

Licensed under either Apache-2.0 or MIT.

Structs§

CompilerOptions
Partial compiler options metadata.
TsConfig
Partial tsconfig.json metadata.
TsConfigExclude
TsConfigExtends
TsConfigInclude

Enums§

TsConfigTextError
Error returned when tsconfig text metadata is empty.