|
1 | 1 | # @szum-tech/prettier-config |
2 | 2 |
|
| 3 | + |
| 4 | +[](https://github.com/JanSzewczyk/prettier-config/pulls) |
| 5 | +[](https://github.com/JanSzewczyk/prettier-config/issues) |
| 6 | + |
| 7 | + |
| 8 | +[](https://github.com/JanSzewczyk/prettier-config/actions/workflows/publish.yml) |
| 9 | + |
| 10 | +[](https://www.npmjs.com/package/@szum-tech/prettier-config) |
| 11 | + |
| 12 | + |
| 13 | +[](https://conventionalcommits.org) |
| 14 | +[](https://github.com/JanSzewczyk/prettier-config/blob/main/LICENSE) |
| 15 | + |
3 | 16 | --- |
4 | 17 |
|
5 | 18 | [Prettier](https://prettier.io/) shareable configuration. |
| 19 | + |
| 20 | +# Table of contents |
| 21 | + |
| 22 | +- [Features](#features) |
| 23 | +- [Technologies](#technologies) |
| 24 | +- [Usage](#usage) |
| 25 | + - [Installation](#installation) |
| 26 | + - [Set configuration](#set-configuration) |
| 27 | + - [Add scripts](#add-scripts) |
| 28 | +- [Changelog](#changelog) |
| 29 | +- [License](#license) |
| 30 | + |
| 31 | +# Features |
| 32 | + |
| 33 | +- [Opinionated code formatter with support for: JavaScript, Typescript, JSX, ...](https://prettier.io/) |
| 34 | +- [Sort the keys of a `package.json` file](https://github.com/matzkoh/prettier-plugin-packagejson#readme) |
| 35 | + |
| 36 | +# Technologies |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +I also used my packages: |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | +# Usage |
| 48 | + |
| 49 | +## Installation |
| 50 | + |
| 51 | +[@szum-tech/prettier-config](https://www.npmjs.com/package/@szum-tech/prettier-config) is available as an [npm package](https://www.npmjs.com/package/@szum-tech/prettier-config). |
| 52 | + |
| 53 | +**npm:** |
| 54 | + |
| 55 | +```shell |
| 56 | +npm install -D prettier @szum-tech/prettier-config |
| 57 | +``` |
| 58 | + |
| 59 | +**yarn:** |
| 60 | + |
| 61 | +```shell |
| 62 | +yarn add -D prettier @szum-tech/prettier-config |
| 63 | +``` |
| 64 | + |
| 65 | +## Set configuration |
| 66 | + |
| 67 | +Full documentation on how to create a Prettier configuration can be found [here](https://prettier.io/docs/en/configuration.html). |
| 68 | + |
| 69 | +Below are the recommended ways to add it: |
| 70 | + |
| 71 | +### 1. Create config file |
| 72 | + |
| 73 | +First create `prettier.config.js` file in root project directory. Then: |
| 74 | + |
| 75 | +```js |
| 76 | +module.exports = require("@szum-tech/prettier-config"); |
| 77 | +``` |
| 78 | + |
| 79 | +### 2. Add to `package.json` file |
| 80 | + |
| 81 | +```json |
| 82 | +{ |
| 83 | + "prettier": "@szum-tech/prettier-config" |
| 84 | +} |
| 85 | +``` |
| 86 | + |
| 87 | +> **Note** You can ignore files by adding it to `.prettierignore`. |
| 88 | +
|
| 89 | +## Add scripts |
| 90 | + |
| 91 | +Optional, can add scripts to `package.json` file : |
| 92 | + |
| 93 | +```json |
| 94 | +{ |
| 95 | + "scripts": { |
| 96 | + "prettier:check": "prettier --check .", |
| 97 | + "prettier:write": "prettier --write ." |
| 98 | + } |
| 99 | +} |
| 100 | +``` |
| 101 | + |
| 102 | +# Changelog |
| 103 | + |
| 104 | +The [changelog](https://github.com/JanSzewczyk/prettier-config/blob/main/CHANGELOG.md) is regularly updated to reflect what's changed in each new release. |
| 105 | + |
| 106 | +# License |
| 107 | + |
| 108 | +This project is licensed under the terms of the [MIT license](https://github.com/JanSzewczyk/prettier-config/blob/main/LICENCE). |
0 commit comments