2024-02-28 17:45:08 +01:00
|
|
|
load("@npm//:prettier/package_json.bzl", prettier = "bin")
|
|
|
|
|
|
|
|
# TODO: SERVER-82329 eslint binary should almost exactly mirror prettier binary
|
|
|
|
# To update prettier change the version in package.json
|
|
|
|
# Run `pnpm install`
|
|
|
|
# Commit changes
|
|
|
|
prettier.prettier_binary(
|
|
|
|
name = "prettier",
|
|
|
|
# Allow the binary to be run outside bazel
|
|
|
|
# See more details about this by commenting this out and running `bazel run //:format`
|
|
|
|
env = {"BAZEL_BINDIR": "."},
|
|
|
|
)
|
|
|
|
|
2024-04-04 01:12:53 +02:00
|
|
|
py_binary(
|
2024-02-28 17:45:08 +01:00
|
|
|
name = "format",
|
2024-04-04 01:12:53 +02:00
|
|
|
srcs = ["format.py"],
|
|
|
|
args = [
|
|
|
|
"--prettier",
|
|
|
|
"$(location :prettier)",
|
|
|
|
],
|
2024-05-17 01:57:57 +02:00
|
|
|
data = [":prettier"],
|
2024-04-04 01:12:53 +02:00
|
|
|
main = "format.py",
|
2024-02-28 17:45:08 +01:00
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|