1.12.1 • Published 10 months ago

@lvjiaxuan/eslint-plugin v1.12.1

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

@lvjiaxuan/eslint-plugin

Usage

Installation:

npm i @lvjiaxuan/eslint-plugin -D

package.json Setting:

{
  "eslintConfig": {
    "extends": "plugin:@lvjiaxuan/recommended"
  }
}

recommended config detail.

Rules

@lvjiaxuan/no-spaces-on-empty-line

const foo = 1
···// A few spaces which would be detected and removed by this rule.
const bar = 2

After soon, I found it as well as no-trailing-spaces. So I set it deprecated, f--king sad.

@lvjiaxuan/prefer-constraint-tuple-type

type Foo<BarArr = []> = [ ...BarArr ] // A rest element type must be an array type.(2574)

Maybe BarArr is better to extend a constraint type even unknown.

type Foo<BarArr extends unknown[] = []> = [ ...BarArr ] // ok.

@lvjiaxuan/no-multi-empty-lines-in-pattern

options:

const options1 = { '@lvjiaxuan/no-multi-empty-lines-in-pattern': [ 'warn', { afterMaxLines: 0, beforeMaxLines: Infinity } ] } // default

const options2 = {
  '@lvjiaxuan/no-multi-empty-lines-in-pattern': [
    'warn',
    {
      ObjectExpression: { afterMaxLines: 0, beforeMaxLines: Infinity },
      // ObjectPattern:
      // ArrayExpression:
      // ArrayPattern:
    },
  ],
}

const options3 = {
  '@lvjiaxuan/no-multi-empty-lines-in-pattern': [
    'warn',
    { afterMaxLines: 0, beforeMaxLines: Infinity },
    {
      ObjectExpression: { afterMaxLines: 2, beforeMaxLines: 2 },
      // ObjectPattern:
      // ArrayExpression:
      // ArrayPattern:
    },
  ],
}
const obj = {
  a: 1,
  b: 2
// This line Would be fixed through removing.
// This line Would be fixed through removing.
}

const {
  a,
  b,
// This line Would be fixed through removing.
// This line Would be fixed through removing.
} = obj

const arr = [
  1,
  2,
// This line Would be fixed through removing.
// This line Would be fixed through removing.
]

const [
  c,
  d
// This line Would be fixed through removing.
// This line Would be fixed through removing.
] = arr

@lvjiaxuan/omit-arrow-curly

Check Test-Cases.

Reference

1.12.1

10 months ago

1.12.0

12 months ago

1.11.0

1 year ago

1.10.1

1 year ago

1.10.0

1 year ago

1.9.1

1 year ago

1.9.0

1 year ago

1.8.2

1 year ago

1.8.1

1 year ago

1.8.0

1 year ago

1.7.0

1 year ago

1.6.0

2 years ago

1.4.0

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

0.20.0

2 years ago

0.19.0

2 years ago

0.16.0

2 years ago

0.18.0

2 years ago

0.13.0

2 years ago

0.14.0

2 years ago

0.15.0

2 years ago

0.8.5

2 years ago

0.8.4

2 years ago

0.8.6

2 years ago

0.11.0

2 years ago

0.10.1

2 years ago

0.12.0

2 years ago

0.11.1

2 years ago

0.11.2

2 years ago

0.11.3

2 years ago

0.11.4

2 years ago

0.11.5

2 years ago

0.8.1

2 years ago

0.5.4

2 years ago

0.8.0

2 years ago

0.5.3

2 years ago

0.8.3

2 years ago

0.7.0

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.3.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.0.25

3 years ago

0.1.0

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.0.21

3 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.24

3 years ago

0.0.20

3 years ago

0.0.19

3 years ago

0.0.18

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago