Skip to content

reacture-io/prettier-config

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@reactute-io/prettier-config

by reacture

A shared Prettier configuration package for Reacture.

Features

  • Consistent formatting: Ensures all code follows the same formatting standards
  • Tailwind CSS support: Includes prettier-plugin-tailwindcss for optimal Tailwind class sorting
  • Modern defaults: Configured with sensible defaults for modern JavaScript/TypeScript development
  • Easy integration: Simple setup process for any project

Installation

Install the package as a dev dependency:

npm install --save-dev @reacture-io/prettier-config
# or
yarn add --dev @reacture-io/prettier-config
# or
pnpm add --save-dev @reacture-io/prettier-config

Usage

Basic Setup

Create a .prettierrc.js file in your project root:

module.exports = require("@reacture-io/prettier-config/base");

Or if you're using ES modules, create a .prettierrc.mjs:

import baseConfig from "@reacture-io/prettier-config/base";
export default baseConfig;

Package.json Configuration

Alternatively, you can add the configuration directly to your package.json:

{
  "prettier": "@reacture-io/prettier-config/base"
}

Configuration

The base configuration includes the following settings:

  • Trailing comma: ES5 style
  • Tab width: 2 spaces
  • Semicolons: Always
  • Quotes: Single quotes
  • JSX quotes: Single quotes
  • Tabs: Spaces only
  • Print width: 80 characters
  • Bracket spacing: Enabled
  • Bracket same line: Enabled
  • Arrow function parentheses: Always
  • Single attribute per line: Enabled
  • End of line: LF (Unix style)
  • Plugins: Tailwind CSS plugin included

IDE Integration

VS Code

  1. Install the Prettier extension
  2. Set Prettier as the default formatter
  3. Enable format on save (optional)

Add to your VS Code settings:

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}

Other Editors

Most modern editors support Prettier configuration files automatically. The configuration will be picked up when you have a .prettierrc.js or package.json configuration in your project.

Scripts

Add these scripts to your package.json for convenient formatting:

{
  "scripts": {
    "format": "prettier --write .",
    "format:check": "prettier --check ."
  }
}

Ignoring Files

Create a .prettierignore file to exclude files from formatting:

node_modules
dist
build

About

@reacture-io package for prettier

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors