diff --git a/docs/rules.md b/docs/rules.md index 9e6f9b63..88df45e2 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -157,7 +157,7 @@ If you have problems getting your `ts_project` to work correctly, read the dedic | assets | Files which are needed by a downstream build step such as a bundler.

These files are **not** included as inputs to any actions spawned by `ts_project`. They are not transpiled, and are not visible to the type-checker. Instead, these files appear among the *outputs* of this target.

A typical use is when your TypeScript code has an import that TS itself doesn't understand such as

`import './my.scss'`

and the type-checker allows this because you have an "ambient" global type declaration like

`declare module '*.scss' { ... }`

A bundler like webpack will expect to be able to resolve the `./my.scss` import to a file and doesn't care about the typing declaration. A bundler runs as a build step, so it does not see files included in the `data` attribute.

Note that `data` is used for files that are resolved by some binary, including a test target. Behind the scenes, `data` populates Bazel's Runfiles object in `DefaultInfo`, while this attribute populates the `transitive_sources` of the `JsInfo`. | `[]` | | extends | Label of the tsconfig file referenced in the `extends` section of tsconfig To support "chaining" of more than one extended config, this label could be a target that provdes `TsConfigInfo` such as `ts_config`. | `None` | | allow_js | Whether TypeScript will read .js and .jsx files. When used with `declaration`, TypeScript will generate `.d.ts` files from `.js` files. | `False` | -| isolated_declarations | TODO | `False` | +| isolated_declarations | Whether to enforce that declaration output (.d.ts file) can be produced for a single source file at a time. Requires some additional explicit types on exported symbols. See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#isolated-declarations | `False` | | declaration | Whether the `declaration` bit is set in the tsconfig. Instructs Bazel to expect a `.d.ts` output for each `.ts` source. | `False` | | source_map | Whether the `sourceMap` bit is set in the tsconfig. Instructs Bazel to expect a `.js.map` output for each `.ts` source. | `False` | | declaration_map | Whether the `declarationMap` bit is set in the tsconfig. Instructs Bazel to expect a `.d.ts.map` output for each `.ts` source. | `False` | diff --git a/ts/defs.bzl b/ts/defs.bzl index cd8b186c..7844c264 100644 --- a/ts/defs.bzl +++ b/ts/defs.bzl @@ -153,7 +153,9 @@ def ts_project( See https://www.typescriptlang.org/docs/handbook/compiler-options.html#compiler-options Typically useful arguments for debugging are `--listFiles` and `--listEmittedFiles`. - isolated_declarations: TODO + isolated_declarations: Whether to enforce that declaration output (.d.ts file) can be produced for a + single source file at a time. Requires some additional explicit types on exported symbols. + See https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-5.html#isolated-declarations transpiler: A custom transpiler tool to run that produces the JavaScript outputs instead of `tsc`.