//ts:format now runs on current working directory, instead of entire repo

This commit is contained in:
Damien Elmes 2021-10-23 15:48:33 +10:00
parent 3b8b71b815
commit a80a267cff
2 changed files with 16 additions and 13 deletions

View file

@ -125,8 +125,21 @@ each file save automatically with:
## Fixing formatting
If the format tests fail, most can be fixed by running `format`
in the relevant package:
For formatting issues with .ts, .svelte and .md files, change to the folder
that's causing the problem, and then run
```
bazel run //ts:format
```
For other packages, change to the folder and run
```
bazel run format
```
For the latter cases, you can also invoke the formatter from another folder by using
the full path:
```
bazel run //rslib:format
@ -134,16 +147,9 @@ bazel run //rslib:sql_format
bazel run //proto:format
bazel run //pylib:format
bazel run //qt:format
bazel run //ts:format
bazel run //pylib/rsbridge:format
```
If you're in one of those folders, you can use the short form:
```
bazel run format
```
## Development speedups
If you're frequently switching between Anki versions, you can create

View file

@ -1,7 +1,4 @@
# this is a hack to invoke prettier directly from Bazel
(cd "${BUILD_WORKSPACE_DIRECTORY}" && node_modules/.bin/prettier \
--config .prettierrc --write \
ts \
qt/aqt/data/web/js \
docs \
)
$BUILD_WORKING_DIRECTORY )