# @febase/prettier-config-svelte

> Shared Prettier config

Latest version **1.3.0** (published 2024-06-04) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.3.0 |
| Published | 2024-06-04 |
| First published | 2023-10-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | 2tl |
| Maintainers | thienlinh |

## Links

- npm: https://www.npmjs.com/package/@febase/prettier-config-svelte
- npm.io page: https://npm.io/package/@febase/prettier-config-svelte

## Dependencies (2)

- [prettier-plugin-svelte](https://npm.io/package/prettier-plugin-svelte.md) ^3.2.3
- [@febase/prettier-config](https://npm.io/package/@febase/prettier-config.md) 1.5.0

## Recent versions

- 1.3.0 (latest) — 2024-06-04
- 1.2.0 — 2024-03-18
- 1.1.0 — 2024-02-09
- 1.0.7 — 2023-12-21
- 1.0.6 — 2023-12-07
- 1.0.5 — 2023-11-20
- 1.0.4 — 2023-11-07
- 1.0.3 — 2023-11-04
- 1.0.2 — 2023-10-31
- 1.0.1 — 2023-10-18
- 1.0.0 — 2023-10-08

## README

# Prettier Config

This package provides `prettier` config for the Svelte projects.

## Prettier and Linters

1. [Prettier Config](https://www.npmjs.com/package/@febase/prettier-config): `Prettier` config for the `Front-end` projects.
2. [Prettier Config](https://www.npmjs.com/package/@febase/prettier-config-svelte): `Prettier` config for the `Svelte` projects.
3. [Eslint Config Base](https://www.npmjs.com/package/@febase/eslint-config-base): `Eslint` config for the `Javascript` projects.
4. [Eslint Config Typescript](https://www.npmjs.com/package/@febase/eslint-config-ts): `Eslint` config for the `Typescript` projects.
5. [Eslint Config React JS](https://www.npmjs.com/package/@febase/eslint-config-react): `Eslint` config for the `React JS` projects.
6. [Eslint Config React TS](https://www.npmjs.com/package/@febase/eslint-config-reactts): `Eslint` config for the `React TS` projects.
7. [Eslint Config Next JS](https://www.npmjs.com/package/@febase/eslint-config-next): `Eslint` config for the `Next JS` projects.
8. [Eslint Config Next TS](https://www.npmjs.com/package/@febase/eslint-config-nextts): `Eslint` config for the `Next TS` projects.
9. [Eslint Config Lit JS](https://www.npmjs.com/package/@febase/eslint-config-lit): `Eslint` config for the `Lit JS` projects.
10. [Eslint Config Lit TS](https://www.npmjs.com/package/@febase/eslint-config-litts): `Eslint` config for the `Lit TS` projects.
11. [Eslint Config Node ESM](https://www.npmjs.com/package/@febase/eslint-config-node-esm): `Eslint` config for the `Node Esm` projects.
12. [Eslint Config Svelte JS](https://www.npmjs.com/package/@febase/eslint-config-svelte): `Eslint` config for the `Svelte` projects.
13. [Eslint Config Svelte TS](https://www.npmjs.com/package/@febase/eslint-config-sveltets): `Eslint` config for the `Svelte TS` projects.

> and more to come.

## Usage

#### 1. Install package

```sh
pnpm add -D prettier @febase/prettier-config-svelte
```

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

```json
{
  "prettier": "@febase/prettier-config-svelte"
}
```

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

```json
{
  "scripts": {
    "format": "prettier --write ."
  }
}
```

## 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
}
```

## Setup git hooks

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

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

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

```json
{
  "lint-staged": {
    "*.{js,jsx,ts,tsx,svelte}": ["pnpm format", "pnpm lint:fix"],
    "*.{json,css,md,html}": ["pnpm format"]
  }
}
```

## Note

- Monorepo: Just setup at the root repo.
- VScode: `Do not` use the below config. Because it may cause conflict order import with this config.

```json
"editor.codeActionsOnSave": {
  "source.organizeImports": true,
},
```

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