anki/ts/eslint.bzl
Damien Elmes 046c6c55d3 use extra rootDir in tsconfig instead of symlinks
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.
2021-10-01 18:36:52 +10:00

23 lines
646 B
Python

load("@npm//eslint:index.bzl", _eslint_test = "eslint_test")
def eslint_test(name = "eslint", srcs = None, exclude = []):
if not srcs:
srcs = native.glob([
"*.ts",
], exclude = exclude)
_eslint_test(
name = name,
args = [
"--max-warnings=0",
"--ext",
".ts",
"-c",
"$(location //ts:.eslintrc.js)",
] + [native.package_name() + "/" + f for f in srcs],
data = [
"//ts:.eslintrc.js",
"@npm//@typescript-eslint/parser",
"@npm//@typescript-eslint/eslint-plugin",
] + srcs,
)