# @lcbase/prettier-config

> Shared Prettier config

Latest version **2.0.1** (published 2023-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lcbase/prettier-config
pnpm add @lcbase/prettier-config
yarn add @lcbase/prettier-config
bun add @lcbase/prettier-config
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2023-08-28 |
| First published | 2023-05-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | @lcbase |
| Maintainers | thienlinh, linh2t |

## Links

- npm: https://www.npmjs.com/package/@lcbase/prettier-config
- Repository: https://github.com/LecleCore/FE-Base
- Homepage: https://github.com/LecleCore/FE-Base#readme
- Issues: https://github.com/LecleCore/FE-Base/issues
- npm.io page: https://npm.io/package/@lcbase/prettier-config

## Dependencies (1)

- [@trivago/prettier-plugin-sort-imports](https://npm.io/package/@trivago/prettier-plugin-sort-imports.md) ^4.2.0

## Recent versions

- 2.0.1 (latest) — 2023-08-28
- 2.0.0 — 2023-08-23
- 1.9.0 — 2023-08-08
- 1.8.0 — 2023-08-08
- 1.7.0 — 2023-08-07
- 1.6.0 — 2023-08-07
- 1.5.0 — 2023-08-06
- 1.4.0 — 2023-07-27
- 1.3.0 — 2023-07-03
- 1.2.4 — 2023-06-29
- 1.2.3 — 2023-06-15
- 1.2.2 — 2023-06-15
- 1.2.1 — 2023-05-31
- 1.2.0 — 2023-05-31
- 1.1.0 — 2023-05-30
- … 1 more at https://npm.io/package/@lcbase/prettier-config/versions

## README

# Prettier Config

This package provides Prettier's Config.

## Usage

#### 1. Install package

```sh
pnpm add -D prettier @lcbase/prettier-config
```

#### 2. Add `"prettier": "@lcbase/prettier-config"` to your `package.json`.

```json
{
  "prettier": "@lcbase/prettier-config"
}
```

#### 3. Add script to your `package.json`.

```json
{
  "scripts": {
    "prettify": "prettier src --check",
    "prettify:fix": "pnpm prettify --write"
  }
}
```

#### 4. Combine with `@lcbase/eslint-config-*` packages

```sh
pnpm add -D eslint @lcbase/eslint-config-*
```

```json
{
  "scripts": {
    "lint": "eslint src",
    "lint:fix": "pnpm lint --fix",
    "prettify": "prettier src --check",
    "prettify:fix": "prettier src --write",
    "format": "pnpm prettify:fix && pnpm lint:fix"
  }
}
```

#### 5. Configuration your `VScode`.

In root your project's folder. Create `.vscode` folder with structure:

```sh
.vscode
  - settings.json
```

```json
{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true
}
```

#### 6. Setup git hooks

- Install packages and global setup `husky`, `lint-staged`.

```sh
pnpm add -D husky lint-staged
npx husky install
npm pkg set scripts.prepare="husky install"
npx husky add .husky/pre-commit "npx lint-staged"
```

- Add the following to your `package.json`:

```json
{
  "scripts": {
    "prepare": "husky install"
  },
  "lint-staged": {
    "*.{js,cjs,mjs,jsx,cjsx,mjsx,ts,mts,cts,tsx,mtsx,ctsx}": ["pnpm format"],
    "*.{json,css,md,html}": ["pnpm prettify:fix"]
  }
}
```

---
_Source: https://npm.io/package/@lcbase/prettier-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
