Prettier

Format code before it's added to your project using Prettier.

The @jsrepo/transform-prettier package is a transform plugin for jsrepo that formats code using your local Prettier configuration before it's added to your project using Prettier.

This is especially useful when you are making use of the jsrepo update command as it will format the code the same way as it is in your project preventing any formatting changes from being shown in the diff.

Installation

To add the @jsrepo/transform-prettier transform to your config run the following command:

jsrepo config transform prettier

This will automatically install the transform and add it to your config:

import { defineConfig } from "jsrepo";
import prettier from "@jsrepo/transform-prettier"; 

export default defineConfig({
	transforms: [prettier()], 
});

On this page