https://github.com/azmag/mag-prettier-config
A conformant Prettier configuration for MAG
https://github.com/azmag/mag-prettier-config
code-style config mag prettier prettier-config prettierconfig prettierrc style-guide
Last synced: 3 months ago
JSON representation
A conformant Prettier configuration for MAG
- Host: GitHub
- URL: https://github.com/azmag/mag-prettier-config
- Owner: AZMAG
- License: mit
- Created: 2021-11-08T17:43:14.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-30T23:17:26.000Z (almost 2 years ago)
- Last Synced: 2025-06-18T20:02:46.542Z (about 1 year ago)
- Topics: code-style, config, mag, prettier, prettier-config, prettierconfig, prettierrc, style-guide
- Language: JavaScript
- Homepage:
- Size: 48.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mag-prettier-config







[](https://github.com/AZMAG/mag-prettier-config/blob/main/LICENSE)
This is Maricopa Association of Governments (MAG) shareable [Prettier](https://prettier.io) config for use in project files. This module defines standard [Prettier](https://prettier.io) rules for code formatting to help format the code in all of our projects.
## :key: Keywords
`config` `prettier` `prettier-config` `prettierrc` `prettierconfig` `code-style` `style-guide` `mag`
## :gear: Installation
Install this Prettier config together with its peer dependencies:
#### Install with `npm`
```bash
$ npm i mag-prettier-config --save-dev
```
Install with yarn
```bash
$ yarn add mag-prettier-config --dev
```
### Peer Dependencies
Peer dependencies need to be installed in order to make it work properly.
- Prettier is an opinionated code formatter.
#### Install with `npm`
```bash
$ npm i prettier --save-dev
```
Install with yarn
```bash
$ yarn add prettier --dev
```
- eslint-config-prettier turns off all rules that are unnecessary or might conflict with [Prettier](https://prettier.io)
#### Install with `npm`
```bash
$ npm i eslint-config-prettier --save-dev
```
Install with yarn
```bash
$ yarn add eslint-config-prettier --dev
```
## Usage
Once you have installed the module and its peer dependencies you will need to add this reference to your `package.json`
```
{
"prettier": "mag-prettier-config",
"eslintConfig": {
"extends": ["prettier"]
},
}
```
Previously, rules had been defined directly in a `.prettierrc `or `package.json`
Any previous `.prettierrc` should be removed in favor of the shared config.
## Options
Prettier ships with a handful of format options.
[Prettier Options](https://prettier.io/docs/en/options.html)
## Current Options
```
{
"$schema": "http://json.schemastore.org/prettierrc",
"printWidth": 100,
"tabWidth": 2,
"useTabs": false,
"singleQuote": false,
"trailingComma": "all",
"endOfLine": "lf",
"semi": false,
"bracketSameLine": true,
"bracketSpacing": true,
"htmlWhitespaceSensitivity": "css",
"arrowParens": "always"
}
```
Prettier rules
This project defines the following settings in the file.
| Rule | Value\* |
| --------------------------------------------------------------------------------------------------- | ---------- |
| [`printWidth`](https://prettier.io/docs/en/options.html#print-width) | **`100`** |
| [`tabWidth`](https://prettier.io/docs/en/options.html#tab-width) | `2` |
| [`useTabs`](https://prettier.io/docs/en/options.html#tabs) | `false` |
| [`singleQuote`](https://prettier.io/docs/en/options.html#quotes) | `false` |
| [`trailingComma`](https://prettier.io/docs/en/options.html#trailing-commas) | **`all`** |
| [`endOfLine`](https://prettier.io/docs/en/options.html#end-of-line) | `lf` |
| [`semi`](https://prettier.io/docs/en/options.html#semicolons) | `false` |
| [`bracketSameLine`](https://prettier.io/docs/en/options.html#jsx-brackets) | **`true`** |
| [`bracketSpacing`](https://prettier.io/docs/en/options.html#bracket-spacing) | `true` |
| [`htmlWhitespaceSensitivity`](https://prettier.io/docs/en/options.html#html-whitespace-sensitivity) | `css` |
| [`arrowParens`](https://prettier.io/docs/en/options.html#arrow-parens) | `always` |
\* Values in **bold** differ from the Prettier defaults.
If you change any options, it’s recommended to do it via the [configuration file](https://github.com/AZMAG/mag-prettier-config/blob/main/index.json).
## Version
### version | 1.1.2
- #### Updated | 2024-07-30
- #### Created | 2021-11-08
Releases will be numbered with the following format:
**`..`**
And constructed with the following guidelines:
1. **MAJOR** version when you make incompatible API changes **bumps the major** resets minor and patch
2. **MINOR** version when you add functionality in a backwards-compatible manner **bumps the minor** resets patch
3. **PATCH** version when you make backwards-compatible bug fixes and misc changes **bumps only the patch**
## Technologies
A list of technologies used within the project:
## :star: Credits
`Maricopa Association of Governments (MAG) and the MAG member agencies`
## :zap: Disclaimer
- [DISCLAIMER](DISCLAIMER.md)
## :warning: Licensing
Copyright 2021 Maricopa Association of Governments (MAG)
This project is licensed under the MIT license.
[](https://github.com/AZMAG/mag-prettier-config/blob/main/LICENSE)
[(Back to top)](#mag-prettier-config)