# eslint-config-standard-typescript-prettier

> A simple eslint config for modern TypeScript projects.

Latest version **6.0.0** (published 2022-07-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-config-standard-typescript-prettier
pnpm add eslint-config-standard-typescript-prettier
yarn add eslint-config-standard-typescript-prettier
bun add eslint-config-standard-typescript-prettier
```

## 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 | 6.0.0 |
| Published | 2022-07-05 |
| First published | 2020-03-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 22 |
| Maintainers | nfour |
| Keywords | eslint, eslint-config, config, typescript, prettier, standardjs, standard |

## Links

- npm: https://www.npmjs.com/package/eslint-config-standard-typescript-prettier
- Repository: https://github.com/nfour/eslint-config-standard-typescript-prettier
- Homepage: https://github.com/nfour/eslint-config-standard-typescript-prettier#readme
- Issues: https://github.com/nfour/eslint-config-standard-typescript-prettier/issues
- npm.io page: https://npm.io/package/eslint-config-standard-typescript-prettier

## Dependencies (1)

- [@types/eslint](https://npm.io/package/@types/eslint.md) ^7.28.0

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

- 6.0.0 (latest) — 2022-07-05
- 2.0.0-alpha (alpha) — 2020-04-11
- 5.0.0 — 2022-01-04
- 5.0.0-0 — 2022-01-04
- 4.2.0 — 2021-02-28
- 4.1.0 — 2021-02-28
- 4.0.0 — 2021-02-28
- 3.2.0 — 2020-07-03
- 3.1.0 — 2020-07-03
- 3.0.0 — 2020-07-03
- 2.2.3 — 2020-05-28
- 2.2.2 — 2020-04-25
- 2.2.1 — 2020-04-25
- 2.2.0 — 2020-04-25
- 2.1.0 — 2020-04-25
- … 9 more at https://npm.io/package/eslint-config-standard-typescript-prettier/versions

## README

# Eslint config: StandardJS, Typescript, Prettier

A simple **eslint** config for modern **TypeScript** projects.

This package configures **eslint** with:
- **Typescript** support https://github.com/typescript-eslint/typescript-eslint
- **StandardJs** rules https://github.com/standard/eslint-config-standard
- **Prettier** rules https://github.com/prettier/eslint-plugin-prettier
- **`@typescript-eslint/recommended`** rules https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin
- Requires semicolons (from prettier) for consistancy with types
- Disables some opinionated type check rules

> For reference: [./eslint.js](./eslint.js).

----------

+ [1. Install](#1-install)
+ [1.1 Install Peer Dependencies](#11-install-peer-dependencies)
+ [2. Configure](#2-configure)
+ [3. Bonus configure](#3-bonus-configure)
+ [FAQ](#faq)
  + [I want fine grained control](#i-want-fine-grained-control)
  + [Eslint cant find my files](#eslint-cant-find-my-files)
  + [I want linting to appear as warnings, not errors](#i-want-linting-to-appear-as-warnings-not-errors)
+ [Project future](#project-future)
+ [Potential issues](#potential-issues)

-----------------

## 1. Install

> Note: For an even "easier" install option, see [eslint-config-nfour](https://github.com/nfour/eslint-config-nfour)

```sh
yarn add -D eslint-config-standard-typescript-prettier
```

## 1.1 Install Peer Dependencies

Install all the peer dependencies listed in [this projects package.json](./package.json) into your project.

This should do the trick:

```sh
npx install-peerdeps -o --dev --yarn eslint-config-standard-typescript-prettier
```

## 2. Configure

Add this to your `package.json`:

```json
"eslintConfig": {
  "extends": ["standard-typescript-prettier"],
  "parserOptions": { "project": "./tsconfig.json" }
},
"prettier": "eslint-config-standard-typescript-prettier/prettier"
```

> For other config recipes, see [I want fine grained control](#I-want-fine-grained-control)

## 3. Bonus configure

Add the comment below to get type checks on your rules in a `.eslintrc.js`

> /** @ts-check @type import('eslint-config-standard-typescript-prettier/types').TsEslintConfig */

![](docs/vscodeTypes.png)

## FAQ

### I want fine grained control

The packages exports a plain object, go nuts!

In an `.eslintrc.js`:

```js
const config = require('eslint-config-standard-typescript-prettier');

module.exports = {
  ...config,
  parserOptions: { project: "./tsconfig.json" },
  rules: {
    ...config.rules,
    "@typescript-eslint/no-explicit-any": "error",
  },
};
```

> Eslint might be changing their config, which is why a `.eslintrc.js` format is recommended.
> 
> More info: https://github.com/eslint/rfcs/pull/9

In a `.prettierrc.js`:

```js
module.exports = {
  ...require('eslint-config-standard-typescript-prettier/prettier'),
  semi: false, // This is how you turn off semicolons, by the way
}
```

### Eslint cant find my files

On the CLI, `eslint` requires the `--ext` flag (currently):
```
eslint --ext .ts,.tsx .
```


### I want linting to appear as warnings, not errors

By default, lint errors can become mixed with TypeScript errors during development.

`eslint-plugin-only-warn` is already included in this package, so do this:

```json
{
  "plugins": ["only-warn"],
  "extends": ["standard-typescript-prettier"],
  "parserOptions": { "project": "./tsconfig.json" }
}
```

Want your lint warnings turned into errors?

> `yarn eslint --max-warnings 1`

## Project future

Javascript churn is real. This project will be kept up to date **only** for as long as configuration remains tedious.

## Potential issues

The peerDependencies listed are versioned for compatibility. Because you maintain these dependencies in your project, you'll have to keep them all in sync or you could have issues.

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