# @ryuuto829/eslint-config-with-prettier

> Dmytro Rykhlyk's default eslint configuration with prettier

Latest version **0.3.0** (published 2021-02-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ryuuto829/eslint-config-with-prettier
pnpm add @ryuuto829/eslint-config-with-prettier
yarn add @ryuuto829/eslint-config-with-prettier
bun add @ryuuto829/eslint-config-with-prettier
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2021-02-16 |
| First published | 2021-01-14 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dmytro Rykhlyk |
| Maintainers | ryuuto829 |
| Keywords | eslint, prettier, config, eslintconfig |

## Links

- npm: https://www.npmjs.com/package/@ryuuto829/eslint-config-with-prettier
- Repository: https://github.com/ryuuto829/eslint-config-with-prettier
- Homepage: https://github.com/ryuuto829/eslint-config-with-prettier#readme
- Issues: https://github.com/ryuuto829/eslint-config-with-prettier/issues
- npm.io page: https://npm.io/package/@ryuuto829/eslint-config-with-prettier

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@pandacss/eslint-plugin](https://npm.io/package/@pandacss/eslint-plugin.md) — 18.7K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2021-02-16
- 0.2.0 — 2021-01-15
- 0.1.0 — 2021-01-14

## README

# eslint-config-with-prettier

These are my default ESLint and Prettier settings ⚡️

> Based on [`Upstatement`](https://github.com/Upstatement)'s [`ESLint`](https://eslint.org/) and [`prettier`](https://prettier.io) configurations.
> Check their documentation on [`Prettier configuration`](https://www.npmjs.com/package/@upstatement/prettier-config) and [`ESLint configuration`](https://www.npmjs.com/package/@upstatement/eslint-config).

## Installation

1. We need to install everything needed by the config:

```sh
# using npx

npx install-peerdeps --dev @ryuuto829/eslint-config-with-prettier

# OR using npm

npm install --save-dev @ryuuto829/eslint-config-with-prettier eslint babel-eslint prettier eslint-config-prettier eslint-plugin-prettier

# OR using yarn

yarn add --dev @ryuuto829/eslint-config-with-prettier eslint babel-eslint prettier eslint-config-prettier eslint-plugin-prettier
```

2. Create an `.eslintrc` file at the root of your project with the following:

```json
{
  "extends": ["@ryuuto829/eslint-config-with-prettier"]
}
```

3. Create a `prettier.config.js` file at the root of your project that contains:

```js
module.exports = require('@ryuuto829/eslint-config-with-prettier/prettier');
```

4. (Optional) Add `.editorconfig` file to the root of the project:

```pl
# This file is for unifying the coding style for different editors and IDEs
# Read more: http://editorConfig.org

# Top-most EditorConfig file
root = true

# Global
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
```

5. (Optional) You can add two scripts to your `package.json` to lint and/or fix:

```json
"scripts": {
  "lint": "eslint .",
  "lint:fix": "eslint . --fix"
},
```

## Using with React

1. Install additional dependencies:

```sh
# If project includes deafult config

yarn add --dev eslint-plugin-react eslint-plugin-jsx-a11y

# OR initiate empty project with react config

yarn add --dev @ryuuto829/eslint-config-with-prettier eslint babel-eslint prettier eslint-config-prettier eslint-plugin-react eslint-plugin-jsx-a11y
```

2. Create an `.eslintrc` file at the root of your project with the following:

```json
{
  "extends": ["@ryuuto829/eslint-config-with-prettier/react"]
}
```

## Pre-commit Hook

You can use [`lint-staged`](https://github.com/okonet/lint-staged) with [`husky`](https://github.com/typicode/husky), which manages git hooks and automatically fix your errors on commit.

1. Install following dependencies:

```sh
yarn add --dev lint-staged husky
```

2. Update your `package.json` like this:

```json
"husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.{js,jsx,ts,tsx,css,json,md}": [
      "prettier --write"
    ],
    "*.js": [
      "eslint --fix"
    ]
  }
```

## Specifying Environments

```json
{
  "extends": ["@ryuuto829/eslint-config-with-prettier"],
  "env": {
    "browser": true,
    "node": true,
    "jest": true
  }
}
```

## Integration with Visual Studio Code

1. Install Prettier extension: `View → Extensions` then find and install Prettier - Code formatter.
2. Install the ESLint extension: `View → Extensions` then find and install ESLint.
3. Reload the editor.
4. In your user settings:

```js
// Format on save with Prettier rules
"editor.formatOnSave": true,
// Tell the ESLint plugin to run on save
"editor.codeActionsOnSave": { "source.fixAll.eslint": true }
```

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