046c6c55d3
The nice thing about the symlink approach is that it allowed tsc -b to function without any changes to the tsconfig.json file, but it meant there were extra links we had to maintain. So instead, we just add an extra rootDirs entry, and add two commented-out lines that can be uncommented when wanting to build with tsc directly.
33 lines
764 B
Python
33 lines
764 B
Python
load(
|
|
"@npm//prettier:index.bzl",
|
|
_prettier_test = "prettier_test",
|
|
)
|
|
|
|
def prettier_test(name = "format_check", srcs = None, exclude = [], **kwargs):
|
|
if not srcs:
|
|
srcs = native.glob([
|
|
"*.ts",
|
|
"*.js",
|
|
"*.svelte",
|
|
], exclude = exclude)
|
|
|
|
_prettier_test(
|
|
name = name,
|
|
args = [
|
|
"--config",
|
|
"$(location //ts:.prettierrc)",
|
|
"--check",
|
|
] + [native.package_name() + "/" + f for f in srcs],
|
|
data = [
|
|
"//ts:.prettierrc",
|
|
"@npm//prettier-plugin-svelte",
|
|
] + srcs,
|
|
**kwargs
|
|
)
|
|
|
|
def prettier(name = "format", **kwargs):
|
|
native.sh_binary(
|
|
name = name,
|
|
srcs = ["format.sh"],
|
|
)
|