Skip to content

Commit

Permalink
tools/test lint: Make globs passed to prettier-eslint absolute.
Browse files Browse the repository at this point in the history
I'm not deeply familiar with the details, but there's an open issue
about an error message we're seeing in the upcoming
`prettier-eslint` update, that says "'basePath' should be an
absolute path.". That's
prettier/prettier-eslint-cli#205.

The first reply at that thread is a workaround that works for us:
make the paths absolute. Instead of using `pwd`, as suggested there,
we reuse our existing `rootdir` variable, which looks like it's
designed for reuse for consistency.
  • Loading branch information
chrisbobbe committed Jun 11, 2020
1 parent 6e75420 commit cea62b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tools/test
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ run_jest() {
run_prettier() {
(( $# )) || return 0
patterns=( "${@/%\///**/*.js}" ) # replace trailing `/` with `/**/*.js`
# Workaround for https://github.com/prettier/prettier-eslint-cli/issues/205
patterns=( "${patterns[@]/#/$rootdir/}" )
prettier-eslint \
${fix:+--write} \
--list-different \
Expand Down

0 comments on commit cea62b7

Please sign in to comment.