Code formatter Prettier 2.0 improves CLI & upgrades to TypeScript 3.8
Prettier helps enforce a consistent style by parsing re-printing your code line-by-line. The new 2.0 release introduces a new CLI that is now more user-intuitive and developer-friendly, changed default values, TypeScript 3.8 features, and more.
Initially released back in early 2017, Prettier has grown up into a more mature opinionated code formatter. The 2.0 release arrived on March 21, 2020. Prettier 2.0 improves defaults, includes a better, more user-friendly CLI, upgrades TypeScript to 3.8 and much more.
From the project’s GitHub README, Prettier “enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary”.
See how 2.0 expands upon its uses and makes Prettier even, well, prettier.
The new CLI is now more user-intuitive and developer-friendly. The new update includes:
- Check pattern existence before glob: See the original issue. This will avoid potential errors encountered with Linux naming.
- Expanded directories: See the pull request.
- Error report changes: Prettier will print a “No matching files” for individual patterns.
- Rearranged file order: When files are processed, they will now sort by order of the specified path. (In previous versions, files were arranged alphabetically.)