Détail du package

@jswork/style-guide

afeiship1MIT1.0.4

My frontend style guide.

eslint, frontend, prettier, style-guide

readme

style-guide

My frontend style guide.

Installation

# For default prettier config
yarn add --dev prettier @jswork/style-guide

# For tailwindcss
yarn add --dev prettier prettier-plugin-tailwindcss @jswork/style-guide

Usage

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

Default:

module.exports = require('@jswork/style-guide');

With Tailwind CSS:

module.exports = require('@jswork/style-guide/tailwind');

Alternatively, you can reference it in your package.json:

{
  "prettier": "@jswork/style-guide"
}

or for tailwind:

{
  "prettier": "@jswork/style-guide/tailwind"
}

Extending the config

You can override the rules in both .prettierrc.js and .prettierrc.json files.

Using .prettierrc.js:

If you want to override some of the rules, you can do so by spreading the base config:

// .prettierrc.js
const baseConfig = require('@jswork/style-guide');

module.exports = {
  ...baseConfig,
  // your overrides here
  semi: false,
  singleQuote: false,
};

Using .prettierrc.json:

Create a .prettierrc.json file and use the extends key to inherit the configuration, then add your overrides.

{
  "extends": "@jswork/style-guide",
  "semi": false,
  "singleQuote": false
}

references