2020-11-01 05:26:58 +01:00
|
|
|
load(
|
|
|
|
"@npm//prettier:index.bzl",
|
|
|
|
_prettier_test = "prettier_test",
|
|
|
|
)
|
|
|
|
|
2020-11-12 11:49:00 +01:00
|
|
|
def prettier_test(name = "format_check", srcs = [], **kwargs):
|
2020-11-01 05:26:58 +01:00
|
|
|
_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
|
|
|
|
)
|
2020-11-12 11:49:00 +01:00
|
|
|
|
|
|
|
def prettier(name = "format", **kwargs):
|
|
|
|
native.sh_binary(
|
|
|
|
name = name,
|
|
|
|
srcs = ["format.sh"],
|
|
|
|
)
|