Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/samislam/prettier-config
samislam prettier configuration template
https://github.com/samislam/prettier-config
Last synced: 1 day ago
JSON representation
samislam prettier configuration template
- Host: GitHub
- URL: https://github.com/samislam/prettier-config
- Owner: samislam
- Created: 2024-11-10T11:26:52.000Z (9 days ago)
- Default Branch: main
- Last Pushed: 2024-11-10T11:39:53.000Z (9 days ago)
- Last Synced: 2024-11-10T12:25:48.632Z (9 days ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @samislam/prettier-config
A custom Prettier configuration for consistent code formatting across projects.
## Installation
To install `samislamPrettierConfig` as a dependency in your project, run:
```
$ npm install samislamPrettierConfig --save-dev
```
Or if you're using Yarn:```
$ yarn add samislamPrettierConfig --dev
```
Or with pnpm:```
$ pnpm add -D samislamPrettierConfig
```# Usage
To use this Prettier configuration, add the following line in your project's package.json:
```json
{
"prettier": "@samislam/prettier-config"
}
```
Or, you can create a .prettierrc.js file in the root of your project with:
```js
module.exports = require("@samislam/prettier-config");
```# Available configurations:
**default configuration**
- **Semi-colons:** Disabled (semi: false)
- **Tab Width:** 2 spaces (tabWidth: 2).
- **Print Width:** 100 characters (printWidth: 100).
- **Single Quotes:** Enabled (singleQuote: true).
- **Trailing Commas:** Enabled for ES5-compatible features (trailingComma: "es5").
- **JSdoc Plugin:** Integrates prettier-plugin-jsdoc for formatting JSDoc comments.**nextjs/react configuration**
- same as the default configurations.
- integrations with the `prettier-plugin-tailwindcss` plugin to automatically sort tailwindcss classes.You can use this configuration by including it in your package.json as follows:
```json
{
"prettier": "@samislam/prettier-config/next.js"
}
```
Or if you're using `.prettierrc.js` you can directly import it:
```js
module.exports = require("@samislam/prettier-config/next");
```# License
MIT