diff --git a/docs/rules.md b/docs/rules.md index 8291cd04..0f327903 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -39,9 +39,9 @@ extended configuration file as well, to pass them both to the TypeScript compile
 ts_project_rule(name, allow_js, args, assets, buildinfo_out, composite, data, declaration,
                 declaration_dir, declaration_map, deps, emit_declaration_only, extends, incremental,
-                js_outs, map_outs, out_dir, preserve_jsx, resolve_json_module, root_dir,
-                skip_lib_check, source_map, srcs, supports_workers, transpile, tsc, tsc_worker,
-                tsconfig, typing_maps_outs, typings_outs)
+                js_outs, map_outs, out_dir, preserve_jsx, resolve_json_module, root_dir, source_map,
+                srcs, supports_workers, transpile, tsc, tsc_worker, tsconfig, typing_maps_outs,
+                typings_outs)
 
Implementation rule behind the ts_project macro. @@ -76,7 +76,6 @@ Implementation rule behind the ts_project macro. | preserve_jsx | https://www.typescriptlang.org/tsconfig#jsx | Boolean | optional | False | | resolve_json_module | https://www.typescriptlang.org/tsconfig#resolveJsonModule | Boolean | optional | False | | root_dir | https://www.typescriptlang.org/tsconfig#rootDir | String | optional | "" | -| skip_lib_check | https://www.typescriptlang.org/tsconfig#skipLibCheck | Integer | optional | 0 | | source_map | https://www.typescriptlang.org/tsconfig#sourceMap | Boolean | optional | False | | srcs | TypeScript source files | List of labels | required | | | supports_workers | Whether the tsc compiler understands Bazel's persistent worker protocol | Boolean | optional | False | @@ -95,7 +94,7 @@ Implementation rule behind the ts_project macro.
 validate_options(name, allow_js, composite, declaration, declaration_map, deps,
                  emit_declaration_only, extends, incremental, preserve_jsx, resolve_json_module,
-                 skip_lib_check, source_map, target, ts_build_info_file, tsconfig, validator)
+                 source_map, target, ts_build_info_file, tsconfig, validator)
 
Validates that some tsconfig.json properties match attributes on ts_project. @@ -117,7 +116,6 @@ Validates that some tsconfig.json properties match attributes on ts_project. | incremental | https://www.typescriptlang.org/tsconfig#incremental | Boolean | optional | False | | preserve_jsx | https://www.typescriptlang.org/tsconfig#jsx | Boolean | optional | False | | resolve_json_module | https://www.typescriptlang.org/tsconfig#resolveJsonModule | Boolean | optional | False | -| skip_lib_check | https://www.typescriptlang.org/tsconfig#skipLibCheck | Integer | optional | 0 | | source_map | https://www.typescriptlang.org/tsconfig#sourceMap | Boolean | optional | False | | target | - | String | optional | "" | | ts_build_info_file | - | String | optional | "" | @@ -152,8 +150,8 @@ Provides TypeScript configuration, in the form of a tsconfig.json file
 ts_project(name, tsconfig, srcs, args, data, deps, assets, extends, allow_js, declaration,
            source_map, declaration_map, resolve_json_module, preserve_jsx, composite, incremental,
-           emit_declaration_only, skip_lib_check, transpiler, ts_build_info_file, tsc, tsc_worker,
-           validate, validator, declaration_dir, out_dir, root_dir, supports_workers, kwargs)
+           emit_declaration_only, transpiler, ts_build_info_file, tsc, tsc_worker, validate,
+           validator, declaration_dir, out_dir, root_dir, supports_workers, kwargs)
 
Compiles one TypeScript project using `tsc --project`. @@ -200,7 +198,6 @@ If you have problems getting your `ts_project` to work correctly, read the dedic | composite | Whether the composite bit is set in the tsconfig. Instructs Bazel to expect a .tsbuildinfo output and a .d.ts output for each .ts source. | False | | incremental | Whether the incremental bit is set in the tsconfig. Instructs Bazel to expect a .tsbuildinfo output. | False | | emit_declaration_only | Whether the emitDeclarationOnly bit is set in the tsconfig. Instructs Bazel *not* to expect .js or .js.map outputs for .ts sources. | False | -| skip_lib_check | Whether skip type checking of declaration files. This can save time during compilation at the expense of type-system accuracy. For example, two libraries could define two copies of the same type in an inconsistent way. Rather than doing a full check of all d.ts files, TypeScript will type check the code you specifically refer to in your app’s source code. | True | | transpiler | A custom transpiler tool to run that produces the JavaScript outputs instead of tsc.

By default, ts_project expects .js outputs to be written in the same action that does the type-checking to produce .d.ts outputs. This is the simplest configuration, however tsc is slower than alternatives. It also means developers must wait for the type-checking in the developer loop.

See [docs/transpiler.md](/docs/transpiler.md) for more details. | None | | ts_build_info_file | The user-specified value of tsBuildInfoFile from the tsconfig. Helps Bazel to predict the path where the .tsbuildinfo output is written. | None | | tsc | Label of the TypeScript compiler binary to run. This allows you to use a custom API-compatible compiler in place of the regular tsc such as a custom js_binary or Angular's ngc. compatible with it such as Angular's ngc.

See examples of use in [examples/custom_compiler](https://github.com/aspect-build/rules_ts/blob/main/examples/custom_compiler/BUILD.bazel) | "@npm_typescript//:tsc" | diff --git a/e2e/test/common.bats b/e2e/test/common.bats index 3f0d70c1..81f96a11 100644 --- a/e2e/test/common.bats +++ b/e2e/test/common.bats @@ -155,7 +155,6 @@ ts_project( out_dir = "${out_dir}", deps = [${deps_joined}], args = [${args_joined}], - skip_lib_check = False, $source_map $declaration $composite diff --git a/examples/skip_lib_check/off/BUILD.bazel b/examples/skip_lib_check/off/BUILD.bazel deleted file mode 100644 index e90126a3..00000000 --- a/examples/skip_lib_check/off/BUILD.bazel +++ /dev/null @@ -1,11 +0,0 @@ -load("@aspect_rules_ts//ts:defs.bzl", "ts_project") - -ts_project( - name = "off", - srcs = ["source.ts"], - skip_lib_check = False, - declaration = True, - deps = [ - "//examples:node_modules/@types/node", - ], -) diff --git a/examples/skip_lib_check/off/source.ts b/examples/skip_lib_check/off/source.ts deleted file mode 100644 index d8ec2468..00000000 --- a/examples/skip_lib_check/off/source.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("test") \ No newline at end of file diff --git a/examples/skip_lib_check/off/tsconfig.json b/examples/skip_lib_check/off/tsconfig.json deleted file mode 100644 index e1115173..00000000 --- a/examples/skip_lib_check/off/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "types": ["node"] - } -} diff --git a/examples/skip_lib_check/on/BUILD.bazel b/examples/skip_lib_check/on/BUILD.bazel deleted file mode 100644 index 59155ab5..00000000 --- a/examples/skip_lib_check/on/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@aspect_rules_ts//ts:defs.bzl", "ts_project") - -ts_project( - name = "on", - srcs = ["source.ts"], - # this is the default value - skip_lib_check = True, - declaration = True, - deps = [ - "//examples:node_modules/@types/node", - ], -) diff --git a/examples/skip_lib_check/on/source.ts b/examples/skip_lib_check/on/source.ts deleted file mode 100644 index d8ec2468..00000000 --- a/examples/skip_lib_check/on/source.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("test") \ No newline at end of file diff --git a/examples/skip_lib_check/on/tsconfig.json b/examples/skip_lib_check/on/tsconfig.json deleted file mode 100644 index e1115173..00000000 --- a/examples/skip_lib_check/on/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "types": ["node"] - } -} diff --git a/examples/skip_lib_check/unspecified/BUILD.bazel b/examples/skip_lib_check/unspecified/BUILD.bazel deleted file mode 100644 index 8cbdbf00..00000000 --- a/examples/skip_lib_check/unspecified/BUILD.bazel +++ /dev/null @@ -1,12 +0,0 @@ -load("@aspect_rules_ts//ts:defs.bzl", "ts_project") - -ts_project( - name = "unspecified", - srcs = ["source.ts"], - declaration = True, - # ts_project will not set the skipLibCheck flag when skip_lib_check is set to None - skip_lib_check = None, - deps = [ - "//examples:node_modules/@types/node", - ], -) diff --git a/examples/skip_lib_check/unspecified/source.ts b/examples/skip_lib_check/unspecified/source.ts deleted file mode 100644 index d8ec2468..00000000 --- a/examples/skip_lib_check/unspecified/source.ts +++ /dev/null @@ -1 +0,0 @@ -console.log("test") \ No newline at end of file diff --git a/examples/skip_lib_check/unspecified/tsconfig.json b/examples/skip_lib_check/unspecified/tsconfig.json deleted file mode 100644 index e1115173..00000000 --- a/examples/skip_lib_check/unspecified/tsconfig.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "compilerOptions": { - "declaration": true, - "types": ["node"] - } -} diff --git a/ts/defs.bzl b/ts/defs.bzl index 756de835..356d62a5 100644 --- a/ts/defs.bzl +++ b/ts/defs.bzl @@ -66,7 +66,6 @@ def ts_project( composite = False, incremental = False, emit_declaration_only = False, - skip_lib_check = True, transpiler = None, ts_build_info_file = None, tsc = _tsc, @@ -232,10 +231,6 @@ def ts_project( Instructs Bazel to expect a `.tsbuildinfo` output. emit_declaration_only: Whether the `emitDeclarationOnly` bit is set in the tsconfig. Instructs Bazel *not* to expect `.js` or `.js.map` outputs for `.ts` sources. - skip_lib_check: Whether skip type checking of declaration files. - This can save time during compilation at the expense of type-system accuracy. - For example, two libraries could define two copies of the same type in an inconsistent way. - Rather than doing a full check of all d.ts files, TypeScript will type check the code you specifically refer to in your app’s source code. ts_build_info_file: The user-specified value of `tsBuildInfoFile` from the tsconfig. Helps Bazel to predict the path where the .tsbuildinfo output is written. @@ -419,7 +414,6 @@ def ts_project( declaration_dir = declaration_dir, source_map = source_map, declaration_map = declaration_map, - skip_lib_check = int(skip_lib_check) if skip_lib_check != None else -1, out_dir = out_dir, root_dir = root_dir, js_outs = tsc_js_outs, diff --git a/ts/private/ts_lib.bzl b/ts/private/ts_lib.bzl index 654a26eb..0bde6bb3 100644 --- a/ts/private/ts_lib.bzl +++ b/ts/private/ts_lib.bzl @@ -117,10 +117,6 @@ COMPILER_OPTION_ATTRS = { "source_map": attr.bool( doc = "https://www.typescriptlang.org/tsconfig#sourceMap", ), - "skip_lib_check": attr.int( - doc = "https://www.typescriptlang.org/tsconfig#skipLibCheck", - values = [-1, 0, 1] - ) } # tsc knows how to produce the following kinds of output files. diff --git a/ts/private/ts_project.bzl b/ts/private/ts_project.bzl index 665a0192..76a7c50c 100644 --- a/ts/private/ts_project.bzl +++ b/ts/private/ts_project.bzl @@ -106,12 +106,6 @@ See https://github.com/aspect-build/rules_ts/issues/228 for more details. "--declarationDir", declaration_dir, ]) - - if ctx.attr.skip_lib_check != -1: - arguments.add_all([ - "--skipLibCheck", - bool(ctx.attr.skip_lib_check), - ]) # When users report problems, we can ask them to re-build with # --define=VERBOSE_LOGS=1