Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eliasnorrby/prettier-config
:pencil: Reusable Prettier config
https://github.com/eliasnorrby/prettier-config
config prettier
Last synced: about 24 hours ago
JSON representation
:pencil: Reusable Prettier config
- Host: GitHub
- URL: https://github.com/eliasnorrby/prettier-config
- Owner: eliasnorrby
- License: mit
- Created: 2019-09-13T17:11:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-06T18:48:28.000Z (over 1 year ago)
- Last Synced: 2024-09-29T05:51:46.270Z (about 1 month ago)
- Topics: config, prettier
- Language: JavaScript
- Homepage:
- Size: 1.32 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Prettier Config
[![Travis](https://img.shields.io/travis/com/eliasnorrby/prettier-config?style=for-the-badge)](https://travis-ci.com/eliasnorrby/prettier-config)
[![npm](https://img.shields.io/npm/v/@eliasnorrby/prettier-config?style=for-the-badge)](https://www.npmjs.com/package/@eliasnorrby/prettier-config)[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=eliasnorrby/prettier-config)](https://dependabot.com)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)My prettier config. It's very close to the defaults, but enables trailing commas
to improve git diffs.:white_check_mark: Updated for prettier v2
# Setup
## Using `npx`
Run the following command to install and configure prettier
```sh
npx @eliasnorrby/prettier-config
```This will run a setup script, adding this package to `devDependencies`, writing
the config to `prettier.config.js` and writing some defaults to
`.prettierignore`. Entries will be appended if a `.prettierignore` already
exists.### `--no-install`
Run setup with the `--no-install` flag to avoid installing this package as a
dependency. Your `pretter.config.js` will contain a sample rule for you to add
to instead of extending this package.## Manually
Install the package
```sh
npm i -D @eliasnorrby/prettier-config
```and add the configuration to `prettier.config.js` or `package.json`.
### `prettier.config.js`
```js
module.exports = require('@eliasnorrby/prettier-config')
```### `package.json`
```json
{
"prettier": "@eliasnorrby/prettier-config"
}
```# Overriding settings
Overriding settings requires the use of a `prettier.config.js` or
`.prettierrc.js`:```js
module.exports = {
...require('@eliasnorrby/prettier-config'),
semi: false,
}
```