anki/ts/prettier.bzl
Damien Elmes b71f55dcc5 make 'bazel run ts:format' work
We're cheating a bit by having it fix files in qt's data folder
as well, but this makes it easier to share the config file.
2020-11-12 20:49:00 +10:00

26 lines
607 B
Python

load(
"@npm//prettier:index.bzl",
_prettier_test = "prettier_test",
)
def prettier_test(name = "format_check", srcs = [], **kwargs):
_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"],
)