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.

For a discussion that will help clarify the arcane bit of Bash here:
https://chat.zulip.org/#narrow/stream/243-mobile-team/topic/.23M4120.20ESLint.206.2E8.2E0.20upgrade/near/889570.
  • Loading branch information
chrisbobbe authored and gnprice committed Aug 4, 2020
1 parent d912959 commit 176c12c
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 176c12c

Please sign in to comment.