@sc-way/config-prettier

1.1.0 • Public • Published

@sc-way: The way SC (@saxoncameron) likes to do things.

Prettier config

An importable, installable Prettier config based on the author's personal preferences.

ℹ️ Note: this includes an .editorconfig under the hood as well.

TOC

Install

  1. First install the config package:
#npm
npm install --save-dev @sc-way/config-prettier

#yarn
yarn --dev @sc-way/config-prettier
  1. and then reference it, in one of the following ways:
  • in package.json:
    • Add this line: "prettier": "@sc-way/config-prettier"
  • or if you prefer to keep it in a separate config file: .prettierrc.js
    • module.exports = require("@sc-way/config-prettier");

Extending the config

To extend/override this config, import it into .prettierrc.js like so:

module.exports = {
  ...require("@sc-way/config-prettier"),
  // your overrides/additions here
};

On differences between Prettier and .editorconfig

EditorConfig's role is to configure your editor so that the code you write is already formatted while Prettier will format your already written code. This allows EditorConfig to be used in many more languages and projects than Prettier.

Using EditorConfig will also avoid Prettier of uselessly formatting your file on save as your editor will already have done the formatting based on EditorConfig's rules. The tricky part though is to make sure Prettier and EditorConfig have the same rules without repeating your configuration in two separate files.

Reference article

Readme

Keywords

none

Package Sidebar

Install

npm i @sc-way/config-prettier

Weekly Downloads

0

Version

1.1.0

License

UNLICENSED

Unpacked Size

3.73 kB

Total Files

6

Last publish

Collaborators

  • saxoncameron