Skip to content

Latest commit

 

History

History

prettier-config

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@davidsneighbour/prettier-config is a shared Prettier configuration for my projects. It's uses the ESM format and exports an object with the configuration.

Add @davidsneighbour/prettier-config to your project

Install the plugin:

npm install --save-dev @davidsneighbour/prettier-config

There are several ways to add a configuration, but the following are the config options I advise to use @davidsneighbour/prettier-config without or with overrides.

Add a key to your package.json file:

{
  "prettier": "@davidsneighbour/prettier-config"
}

or create a .prettierrc.js file and export an object that overrides settings:

import prettierConfig from "@davidsneighbour/prettier-config";
export default {
  ...prettierConfig,
  // Add your overrides here.
};

If your project does not uses the ESM format, you need to use the .mjs extension for this file.

Use with TailwindCSS

This configuration implements Tailwind's Prettier Plugin. To activate it either have a tailwind.config.js in your project root or override the prettier configuration at tailwindConfig with the proper path.

const defaultConfiguration = require("@davidsneighbour/prettier-config");
const localConfiguration = {
  tailwindConfig: "new path to your config",
};
const configuration = {
  ...defaultConfiguration,
  ...localConfiguration,
};
module.exports = configuration;

More information

All configurations

Configurations
Build Tools
Babel Webpack
Testing
Cypress HTML Validate
Linters and Formatters
Browserslist ESLint PostCSS
Prettier Stylelint
Project Management
Commitlint Release
Markdown and Writing
Markdownlint Remark Lint
Other Tools
Bootstrap Tools