Skip to content

Commit

Permalink
docs(eslint-plugin): rules more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lvjiaxuan committed Oct 18, 2022
1 parent 095ca16 commit d3f7163
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions packages/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,34 @@ npm i @lvjiaxuan/eslint-plugin
}
```

## Supported Rules
> [`recommended` config detail](https://github.com/lvjiaxuan/eslint-config/blob/main/packages/eslint-plugin/src/configs/recommended.ts)
- [no-spaces-on-empty-line](https://github.com/lvjiaxuan/eslint-config/blob/main/packages/eslint-plugin-lvjiaxuan/src/rules/no-spaces-on-empty-line.ts)(as well as [no-trailing-spaces](https://eslint.org/docs/latest/rules/no-trailing-spaces))
- [prefer-constraint-array-type](https://github.com/lvjiaxuan/eslint-config/blob/main/packages/eslint-plugin-lvjiaxuan/src/rules/prefer-constraint-array-type.ts)
## Rules

### [no-spaces-on-empty-line](https://github.com/lvjiaxuan/eslint-config/blob/main/packages/eslint-plugin-lvjiaxuan/src/rules/no-spaces-on-empty-line.ts)

<!-- eslint-skip -->
```js
const foo = 1
// A few spaces which would be detected and removed by this rule.
const bar = 2
```

> After I found it as well as [no-trailing-spaces](https://eslint.org/docs/latest/rules/no-trailing-spaces). So I set it deprecated, f--king sad.

### [prefer-constraint-array-type](https://github.com/lvjiaxuan/eslint-config/blob/main/packages/eslint-plugin-lvjiaxuan/src/rules/prefer-constraint-array-type.ts)

<!-- eslint-skip -->
```ts
type Foo<BarArr = []> = [ ...BarArr ] // A rest element type must be an array type.(2574)
```
Maybe It is Prefer to a constraint type.
<!-- eslint-skip -->
```ts
type Foo<BarArr extends unknown[] = []> = [ ...BarArr ] // ok.
```
## Refer
Expand Down

0 comments on commit d3f7163

Please sign in to comment.