Run Eslint with Bazel #3633
Replies: 4 comments 1 reply
-
rules_nodejs is no longer maintained. I started some work on "proper" eslint support under Bazel: aspect-build/rules_js#658 |
Beta Was this translation helpful? Give feedback.
-
Thanks for your response Alex.
|
Beta Was this translation helpful? Give feedback.
-
Something like this is what ended up working for me: load("@npm//:eslint/package_json.bzl", eslint_bin = "bin")
eslint_bin.eslint_test(
name = "lint",
chdir = package_name(),
data = glob(["src/**/*.ts", "src/**/*.tsx"]) + [".eslintrc.cjs"],
args = ["."],
) And you can swap out |
Beta Was this translation helpful? Give feedback.
-
I made a new ruleset rules_lint that provides first-class support for this: https://github.com/aspect-build/rules_lint/blob/main/docs/eslint.md |
Beta Was this translation helpful? Give feedback.
-
Hey everyone,
Is there any way to run "lint": "eslint --ext .js,.ts,.jsx,.tsx src" script with Bazel?
I could not find anything on google.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions