# eslint-plugin-comment-above-typeorm-entity

> An eslint plugin that forces you to comment just above the typeorm entity to describe it

Latest version **1.0.0** (published 2022-05-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-plugin-comment-above-typeorm-entity
pnpm add eslint-plugin-comment-above-typeorm-entity
yarn add eslint-plugin-comment-above-typeorm-entity
bun add eslint-plugin-comment-above-typeorm-entity
```

## 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.0.0 |
| Published | 2022-05-24 |
| First published | 2022-05-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | minericefield |
| Maintainers | minericefield |
| Keywords | eslint, eslint-plugin, typeorm |

## Links

- npm: https://www.npmjs.com/package/eslint-plugin-comment-above-typeorm-entity
- Repository: git@github.com:minericefield/eslint-plugin-comment-above-typeorm-entity
- npm.io page: https://npm.io/package/eslint-plugin-comment-above-typeorm-entity

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

- 1.0.0 (latest) — 2022-05-24

## README

# eslint-plugin-comment-above-typeorm-entity

An eslint plugin that forces you to comment just above the typeorm entity to describe it.

## Quick start

##### Install

```
$ yarn add --dev eslint-plugin-comment-above-typeorm-entity
```

##### In your .eslintrc

```javascript
module.exports = {
  plugins: ["eslint-plugin-comment-above-typeorm-entity"],
  rules: {
    "comment-above-typeorm-entity/comment-requirement": "error",
  },
};
```

## Examples

#### OK

````typescript
// Some comment to describe...
@Entity()
export class User {
  @PrimaryGeneratedColumn({ comment: "id" })
  id!: number;
}
````

````typescript
@Entity()
/**
 * Some comment to describe...
 */
export class User {
  @PrimaryGeneratedColumn({ comment: "id" })
  id!: number;
}
````

#### NG

````typescript
@Entity()
export class User {
  @PrimaryGeneratedColumn({ comment: "id" })
  id!: number;
}
````

## Motivation

Seems like the typeorm entity currently doesn't allow us to add table comments.  
It would be comfortable if we could do something like this.
```typescript
@Entity({ comment: "Some description..." })
```
But we can't.  
During code reviews and development at work, I'm having a hard time understanding what an entity or the table is for.  
Examples above are just simple User Entities, but in reality, there are a number of more complex and unique concepts.  
So I made a eslint plugin that forces to explain  entities by comment.

## License

This software is distributed under [MIT license](LICENSE.txt).

---
_Source: https://npm.io/package/eslint-plugin-comment-above-typeorm-entity · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
