# eslint-config-p-ts

> P's base JS ESLint config, following our styleguide.

Latest version **0.2.0** (published 2022-06-23) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install eslint-config-p-ts
pnpm add eslint-config-p-ts
yarn add eslint-config-p-ts
bun add eslint-config-p-ts
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2022-06-23 |
| First published | 2020-05-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 7.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Takuya Eguchi |
| Maintainers | akagire |
| Keywords | eslint |

## Links

- npm: https://www.npmjs.com/package/eslint-config-p-ts
- Repository: https://github.com/Akagire/eslint-config-p-ts
- Homepage: https://github.com/Akagire/eslint-config-p-ts#readme
- Issues: https://github.com/Akagire/eslint-config-p-ts/issues
- npm.io page: https://npm.io/package/eslint-config-p-ts

## Dependencies (5)

- [eslint-plugin-import](https://npm.io/package/eslint-plugin-import.md) ^2.20.2
- [eslint-plugin-no-null](https://npm.io/package/eslint-plugin-no-null.md) ^1.0.2
- [eslint-config-airbnb-base](https://npm.io/package/eslint-config-airbnb-base.md) ^15.0.0
- [@typescript-eslint/eslint-plugin](https://npm.io/package/@typescript-eslint/eslint-plugin.md) ^5.0.0
- [eslint-plugin-use-optional-annotation](https://npm.io/package/eslint-plugin-use-optional-annotation.md) ^1.0.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
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 0.2.0 (latest) — 2022-06-23
- 0.1.10 — 2021-10-28
- 0.1.9 — 2021-09-04
- 0.1.8 — 2021-06-24
- 0.1.7 — 2021-03-27
- 0.1.6 — 2020-11-24
- 0.1.5 — 2020-09-25
- 0.1.4 — 2020-07-22
- 0.1.3 — 2020-06-30
- 0.1.2 — 2020-05-26
- 0.1.1 — 2020-05-19
- 0.1.0 — 2020-05-18

## README

# eslint-config-p-ts

This package provides P's base TS .eslintrc as an extensible shared config.

This configure was created from this document.
https://github.com/basarat/typescript-book/blob/master/docs/styleguide/styleguide.md

## Changed rules from TypeScript books style guide

### Naming

#### [MUST] Use prefix `I` to interface

Yes, it is useless, but rules is not unnecessary in rules.
I think, `don't use prefix I` is also perfect rule.
You can customize it in your project.

*Bad*
```ts
interface MyProps {
  hoge: string;
  fuga: number;
}
```

*Good*
```ts
interface IMyProps {
  hoge: string;
  fuga: number;
}
```

### Export

#### [SHOULD] No export default

Please ignore this when needs use default export in framework. (eg Nuxt's middleware)

*Bad*
```ts
class Foo {}
export default Foo;
```

*Good*
```ts
export class Foo {}
```

### Semicolon

### [MUST] Use Semicolons in interfaces

In TypeScript, you can separate interfaces with semicolons, also can use commas too. But modern coding rule is recommended use semicolon.

*Bad*

```ts
interface Hoge {
  huga: string,
  piyo: number,
}

const foo: { bar: string, baz: number } = { bar: 'bar', baz: 0 };
```

*Good*

```ts
interface Hoge {
  huga: string;
  piyo: number;
}

const foo: { bar: string; baz: number; } = { bar: 'bar', baz: 0 };
```


## Usage

Packaged our JavaScript / TypeScript coding standard.

1. Install dependencies packages.

```
yarn add -D eslint-config-p-ts
```

2. Add your `.eslintrc` 's `extends` section.

```.eslintrc
extends: ['p-ts']
```

Please note here has meaning to the position. We prefer put it last or put before `prettier`.

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