2021-04-30 23:31:38 +02:00
|
|
|
load("@build_bazel_rules_nodejs//:index.bzl", "js_library", "pkg_npm")
|
|
|
|
|
|
|
|
PKG_BASE_NAME = "kbn-eslint-plugin-eslint"
|
|
|
|
PKG_REQUIRE_NAME = "@kbn/eslint-plugin-eslint"
|
|
|
|
|
|
|
|
SOURCE_FILES = glob(
|
|
|
|
[
|
|
|
|
"rules/**/*.js",
|
2021-09-02 03:05:45 +02:00
|
|
|
"helpers/**/*.js",
|
2021-04-30 23:31:38 +02:00
|
|
|
"index.js",
|
|
|
|
"lib.js",
|
|
|
|
],
|
|
|
|
exclude = [
|
|
|
|
"**/*.test.*",
|
|
|
|
"**/__fixtures__"
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
SRCS = SOURCE_FILES
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "srcs",
|
|
|
|
srcs = SRCS,
|
|
|
|
)
|
|
|
|
|
|
|
|
NPM_MODULE_EXTRA_FILES = [
|
|
|
|
"package.json",
|
|
|
|
"README.md",
|
|
|
|
]
|
|
|
|
|
|
|
|
DEPS = [
|
2021-10-02 17:38:40 +02:00
|
|
|
"@npm//@babel/eslint-parser",
|
2021-04-30 23:31:38 +02:00
|
|
|
"@npm//dedent",
|
|
|
|
"@npm//eslint",
|
|
|
|
"@npm//eslint-module-utils",
|
|
|
|
"@npm//micromatch",
|
|
|
|
]
|
|
|
|
|
|
|
|
js_library(
|
|
|
|
name = PKG_BASE_NAME,
|
|
|
|
srcs = NPM_MODULE_EXTRA_FILES + [
|
|
|
|
":srcs",
|
|
|
|
],
|
|
|
|
deps = DEPS,
|
|
|
|
package_name = PKG_REQUIRE_NAME,
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|
|
|
|
|
|
|
|
pkg_npm(
|
|
|
|
name = "npm_module",
|
|
|
|
deps = [
|
|
|
|
":%s" % PKG_BASE_NAME,
|
|
|
|
]
|
|
|
|
)
|
|
|
|
|
|
|
|
filegroup(
|
|
|
|
name = "build",
|
|
|
|
srcs = [
|
|
|
|
":npm_module",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
)
|