@afonsopimenta/prettier-config v2.1.1
Prettier config for Next.js + TailwindCSS
Reusable prettier config aimed at Next.js projects with TailwindCSS.
Overview
This package provides a shared Prettier configuration for Next.js projects with TailwindCSS.
The goal is to provide a consistent set of styling rules for all Next.js projects, while still allowing project-specific customization when necessary.
Requirements
This package requires prettier
to be installed in your project. To install it, run:
npm install --save-dev prettier
Installation and Usage
To install the package, run:
npm install --save-dev @afonsopimenta/prettier-config
Then, add the following to your package.json
file:
{
"scripts": {
"format": "prettier --write ."
},
"prettier": "@afonsopimenta/prettier-config"
}
If you want to expand or override the default configuration, you can do so by not adding this line to your package.json
:
"prettier": "@afonsopimenta/prettier-config"
And instead creating a prettier.config.mjs
file in the root of your project with the following content:
import baseConfig from "@afonsopimenta/prettier-config";
/** @type {import("prettier").Config} */
const config = {
...baseConfig,
// Add your overrides here
};
export default config;
For more information on prettier configuration files see the official documentation.
Now, every time you run the command npm run format
, all files in your project will be formatted according to the rules defined in this package.