# @j0hnm4r5/eslint-config

> [![GitHub Release](https://img.shields.io/github/v/release/j0hnm4r5/eslint-config.svg?style=flat)](https://github.com/j0hnm4r5/eslint-config/releases) ![NPM Downloads](https://img.shields.io/npm/dw/@j0hnm4r5/eslint-config?style=flat) ![GitHub Build](https

Latest version **2.1.8** (published 2021-03-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @j0hnm4r5/eslint-config
pnpm add @j0hnm4r5/eslint-config
yarn add @j0hnm4r5/eslint-config
bun add @j0hnm4r5/eslint-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.1.8 |
| Published | 2021-03-10 |
| First published | 2019-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 17 |
| Unpacked size | 10.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | John Mars |
| Maintainers | j0hnm4r5 |
| Keywords | eslint, eslintconfig |

## Links

- npm: https://www.npmjs.com/package/@j0hnm4r5/eslint-config
- npm.io page: https://npm.io/package/@j0hnm4r5/eslint-config

## Dependencies (17)

- [eslint](https://npm.io/package/eslint.md) ^7.13.0
- [prettier](https://npm.io/package/prettier.md) ^2.1.2
- [eslint-plugin-react](https://npm.io/package/eslint-plugin-react.md) ^7.21.5
- [eslint-config-airbnb](https://npm.io/package/eslint-config-airbnb.md) >=18.0.0
- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.22.1
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^4.2.1
- [eslint-plugin-unicorn](https://npm.io/package/eslint-plugin-unicorn.md) ^28.0.2
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^8.1.0
- [eslint-plugin-jsx-a11y](https://npm.io/package/eslint-plugin-jsx-a11y.md) ^6.4.1
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^3.1.0
- [eslint-plugin-no-secrets](https://npm.io/package/eslint-plugin-no-secrets.md) ^0.8.9
- [@typescript-eslint/parser](https://npm.io/package/@typescript-eslint/parser.md) ^4.4.1
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^14.2.0
- [eslint-plugin-react-hooks](https://npm.io/package/eslint-plugin-react-hooks.md) ^4.2.0
- [eslint-plugin-eslint-comments](https://npm.io/package/eslint-plugin-eslint-comments.md) ^3.2.0
- [eslint-config-airbnb-typescript](https://npm.io/package/eslint-config-airbnb-typescript.md) ^12.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^4.4.1

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

- 2.1.8 (latest) — 2021-03-10
- 2.1.7 — 2021-03-10
- 2.1.6 — 2020-12-07
- 2.1.5 — 2020-12-07
- 2.1.4 — 2020-11-10
- 2.1.3 — 2020-11-10
- 2.1.2 — 2020-11-03
- 2.1.1 — 2020-11-03
- 2.1.0 — 2020-11-02
- 2.0.3 — 2020-11-02
- 2.0.2 — 2020-11-02
- 2.0.1 — 2020-11-02
- 2.0.0 — 2020-11-02
- 1.1.1 — 2020-09-14
- 1.1.0 — 2020-09-14
- … 15 more at https://npm.io/package/@j0hnm4r5/eslint-config/versions

## README

# @j0hnm4r5/eslint-config

[![GitHub Release](https://img.shields.io/github/v/release/j0hnm4r5/eslint-config.svg?style=flat)](https://github.com/j0hnm4r5/eslint-config/releases)
![NPM Downloads](https://img.shields.io/npm/dw/@j0hnm4r5/eslint-config?style=flat)
![GitHub Build](https://img.shields.io/github/workflow/status/j0hnm4r5/eslint-config/Publish%20Package?style=flat)


## About

This [ESLint](https://eslint.org/) config is built on top of [Airbnb's config](https://www.npmjs.com/package/eslint-config-airbnb) and [Unicorn](https://www.npmjs.com/package/eslint-plugin-unicorn). It includes [Prettier](https://prettier.io/) to automatically format code.

## Instructions

1. Install `eslint` and this config in your project with `yarn add -D eslint @j0hnm4r5/eslint-config`

2. In your `.eslintrc` file, add one of the following to the `extends` array:

|   |   |
|---|---|
| Vanilla (default): | `"@j0hnm4r5/eslint-config"` |
| TypeScript without React : | `"@j0hnm4r5/eslint-config/configs/ts"` |
| React: | `"@j0hnm4r5/eslint-config/configs/react"` |
| TypeScript with React: | `"@j0hnm4r5/eslint-config/configs/ts-react"` |


That's it! All of the extended configs, Prettier, and some extra rule changes should just work out of the box.

---

## Example Usage

This should change depending on the project, but here's what I like to use as a baseline:

**.eslintrc**
```js
// .eslintrc
{
  "env": {
    "node": true,
    "browser": true,
    "es2020": true,
  },
  "extends": [
    "@j0hnm4r5/eslint-config"
  ],
}
```

---

### Typescript

If you're using TypeScript, add this to your `.eslintrc` too:

```js
// inside .eslintrc root object
"parserOptions": {
	"project": "./tsconfig.json"
}
```

As well as a **tsconfig.json** file at the root of the project:

**Node**

```js
// tsconfig.json
{
  "compilerOptions": {
    "lib": ["es2020"],
    "module": "commonjs",
    "target": "es2020",

    "sourceMap": true,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "exclude": [
    "node_modules"
  ]
}
```

**Browser**

```js
// tsconfig.json
{
  "compilerOptions": {
    "lib": ["es2020", "dom"],
    "module": "commonjs",
    "target": "es6",
    
    "jsx": "react",
    
    "sourceMap": true,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "exclude": [
    "node_modules"
  ]
}
```

---

### Prettier

And don't forget your Prettier configs! Here's what I use:

**.prettierrc**
```js
// .prettierrc
{
  "printWidth": 62, // perfect size for my vscode window
  "tabWidth": 2,
  "useTabs": true,
  "semicolons": true,
  "singleQuote": false,
  "quoteProps": "consistent",
  "jsxSingleQuote": false,
  "trailingComma": "es5",
  "bracketSpacing": true,
  "jsxBracketSameLine": false,
  "arrowParens": "always"
}
```

**.prettierignore**
```sh
# .prettierignore
package.json
package-lock.json
yarn.lock
node_modules
public
.cache
```

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