@werkzeugkiste/prettier-config

2.0.0 • Public • Published

@werkzeugkiste/prettier-config

This is the shared Prettier config for all things @werkzeugkiste related.

Installation

yarn add --dev @werkzeugkiste/prettier-config
npm install --develop @werkzeugkiste/prettier-config

Afterwards install all peerDependencies into your project and create a .prettierrc.js file:

# install peer dependencies:
npx install-peerdeps --dev @werkzeugkiste/prettier-config

# create .prettierrc.js config file:
npx @werkzeugkiste/prettier-config

Setup

If you want to use this config as base in any of your projects, you need to create a .prettierrc.js file in your project folder that re-exports the Prettier config from @werkzeugkiste/prettier-config.

You can either do that automatically by running the following command in the root folder of your project (where your package.json is):

# create .prettierrc.js config file:
npx @werkzeugkiste/prettier-config

or by manually adding the following content:

module.exports = require('@werkzeugkiste/prettier-config');

Important: filename must be .prettierrc.js or prettier.config.js or otherwise Prettier will try to parse it as JSON or YML and will fail.

Quick copy+paste shell command:

echo "module.exports = require('@werkzeugkiste/prettier-config');" > .prettierrc.js

If you feel the urge to override some of the rules, you can do it this way:

module.exports = {
  ...require('@werkzeugkiste/prettier-config'),
  // add your overrides here
};

Read the Prettier docs on sharing configurations for more info.

/@werkzeugkiste/prettier-config/

    Package Sidebar

    Install

    npm i @werkzeugkiste/prettier-config

    Weekly Downloads

    112

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    11.7 kB

    Total Files

    7

    Last publish

    Collaborators

    • manuelbieh