Prettier driver
Provides Prettier support by dynamically generating a
prettier.config.js
config file.
#
Requirements- Prettier ^2.0.0
#
EventsCan be listened to on the PrettierDriver
instance.
Event | Arguments | Description |
---|---|---|
onCreateIgnoreFile | context: ConfigContext, path: Path, config: { ignore: string[] } | Called before the ignore file is written. |
#
InstallationIn your configuration module, install the driver and Prettier.
- Yarn
- NPM
Create a file at configs/prettier.ts
(or js
) in which to house your Prettier configuration.
#
IntegrationIn your consuming project, enable the driver by adding prettier
to your drivers
config.
#
Ignoring pathsInstead of using an .prettierignore
dotfile, you can define an ignore
property in your
configuration module's configs/prettier.ts
file, or a project's .config/beemo/prettier.ts
file.
This property accepts an array of strings. For example:
Becomes...
This feature follows the same configuration lifecycle as prettier.config.js
, with the added
benefit of conditional logic, and being generated at runtime!