aspect-build / aspect-build/rules_lint
[Bug]: Why is prettier not ignoring node_modules folder?
- Dominant language
- Starlark
- Stars
- 154
- Forks
- 125
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 20
Description
### What happened?
I run `bazel run //:format path_to_dir_to_check`, where format is an alias to `//tools/format:format.check`, which subsequently runs the `format_multirun`, where `javascript = ":prettier"`. The results I receive in the terminal are `[error] No matching files. Patterns: path_to_dir_to_check/node_modules/`, followed by a list of node_modules it could not pattern match.
What I expect to happen is a successful prettier check of the `path_to_dir_to_check` with the results of the check.
### Version
Development (host) and target OS/architectures: Darwin Kernel Version 22.6.0 arm64
Output of `bazel --version`: aspect 5.9.36
Version of the Aspect rules, or other relevant rules from your
`WORKSPACE` or `MODULE.bazel` file:
Language(s) and/or frameworks involved: Typescript, Javascript
### How to reproduce
```shell
Running `bazel run //:format path_to_dir_to_check` at the root directory.
```
### Any other information?
Example output after running the command
```
Computing main repo mapping:
Loading:
Loading: 0 packages loaded
Analyzing: target //:format (0 packages loaded, 0 targets configured)
Analyzing: target //:format (0 packages loaded, 0 targets configured)
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
INFO: Analyzed target //:format (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target //tools/format:format up-to-date:
bazel-bin/tools/format/format.bash
INFO: Elapsed time: 0.137s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/tools/format/format.bash path_to_dir_to_check
[error] No matching files. Patterns: apps/app_one_name/node_modules/@jest/core/node_modules/chalk/node_modules/ansi-styles/index.js path_to_dir_to_check/node_modules/@jest/core/node_modules/supports-color/index.js path_to_dir_to_check/node_modules/@jest/core/node_modules/supports-color/browser.js path_to_dir_to_check/node_modules/@jest/core/node_modules/pretty-format/build/types.js path_to_dir_to_check/node_modules/@jest/core/node_modules/pretty-format/build/plugins/ReactTestComponent.js path_to_dir_to_check/node_modules/@jest/core/node_modules/pretty-format/build/plugins/ReactElement.js
```
Contributor guide
Research direction
Start at the //tools/format:format.check alias and its format_multirun configuration, where javascript is set to :prettier. Reproduce the command with a directory containing node_modules and inspect how the directory is converted into Prettier patterns. Done means the check processes the requested directory without reporting node_modules files as unmatched patterns.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100