Skip to content

Commit

Permalink
build: improve errors printed by Prettier
Browse files Browse the repository at this point in the history
Use `--check` instead of `--list` when linting source code formatting.

The option `--list` produces very terse output which makes it difficult
to understand what's the problem and how to fix it:

```
> [email protected] prettier:cli /Users/bajtos/src/loopback/next
> node packages/build/bin/run-prettier "**/*.ts" "**/*.js" "**/*.md" "-l"

packages/core/src/application.ts
```

The option `--check` is more verbose:

```
> [email protected] prettier:cli /Users/bajtos/src/loopback/next
> node packages/build/bin/run-prettier "**/*.ts" "**/*.js" "**/*.md" "--check"

Checking formatting...
packages/core/src/application.ts
Code style issues found in the above file(s). Forgot to run Prettier?
```

Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored and raymondfeng committed Apr 7, 2020
1 parent 0b1a65a commit 741ba10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"eslint": "node packages/build/bin/run-eslint --report-unused-disable-directives --cache .",
"eslint:fix": "npm run eslint -- --fix",
"prettier:cli": "node packages/build/bin/run-prettier \"**/*.ts\" \"**/*.js\" \"**/*.md\"",
"prettier:check": "npm run prettier:cli -- -l",
"prettier:check": "npm run prettier:cli -- --check",
"prettier:fix": "npm run prettier:cli -- --write",
"clean": "lerna run clean && node packages/build/bin/run-clean \"packages/*/dist\" \"extensions/*/dist\" \"examples/*/dist\" \"benchmark/dist\"",
"clean:lerna": "lerna clean",
Expand Down

0 comments on commit 741ba10

Please sign in to comment.