Skip to main content

Prettier driver

Provides Prettier support by dynamically generating a prettier.config.js config file.


  • Prettier ^2.0.0


Can be listened to on the PrettierDriver instance.

onCreateIgnoreFilecontext: ConfigContext, path: Path, config: { ignore: string[] }Called before the ignore file is written.


In your configuration module, install the driver and Prettier.

yarn add @beemo/driver-prettier prettier

Create a file at configs/prettier.ts (or js) in which to house your Prettier configuration.

import { PrettierConfig } from '@beemo/driver-prettier';
const config: PrettierConfig = {
arrowParens: 'always',
trailingComma: 'all',
// ...
export default config;


In your consuming project, enable the driver by adding prettier to your drivers config.

import { BeemoConfig } from '@beemo/core';
const config: BeemoConfig = {
module: '<config-module>',
drivers: ['prettier'],
export default config;

Ignoring paths#

Instead 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:



import { PrettierConfig } from '@beemo/driver-prettier';
const config: PrettierConfig = {
// ...
ignore: ['lib/', '*.min.js', '*.map'],
export default config;

This feature follows the same configuration lifecycle as prettier.config.js, with the added benefit of conditional logic, and being generated at runtime!