File tree 7 files changed +5927
-37
lines changed
7 files changed +5927
-37
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ import type { JSXFragment } from '../expression/JSXFragment/spec';
9
9
import type { MemberExpression } from '../expression/MemberExpression/spec' ;
10
10
import type { MetaProperty } from '../expression/MetaProperty/spec' ;
11
11
import type { ObjectExpression } from '../expression/ObjectExpression/spec' ;
12
+ import type { SequenceExpression } from '../expression/spec' ;
12
13
import type { Super } from '../expression/Super/spec' ;
13
14
import type { TaggedTemplateExpression } from '../expression/TaggedTemplateExpression/spec' ;
14
15
import type { ThisExpression } from '../expression/ThisExpression/spec' ;
@@ -34,6 +35,7 @@ export type LeftHandSideExpression =
34
35
| MetaProperty
35
36
| ObjectExpression
36
37
| ObjectPattern
38
+ | SequenceExpression
37
39
| Super
38
40
| TaggedTemplateExpression
39
41
| ThisExpression
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change
1
+ # require or disallow padding lines between statements (` padding-line-between-statements ` )
2
+
3
+ ## Rule Details
4
+
5
+ This rule extends the base [ ` eslint/padding-line-between-statements ` ] ( https://eslint.org/docs/rules/padding-line-between-statements ) rule.
6
+
7
+ ** It adds support for TypeScript constructs such as ` interface ` and ` type ` .**
8
+
9
+ ## How to use
10
+
11
+ ``` jsonc
12
+ {
13
+ // note you must disable the base rule as it can report incorrect errors
14
+ " padding-line-between-statements" : " off" ,
15
+ " @typescript-eslint/padding-line-between-statements" : [
16
+ " error" ,
17
+ {
18
+ " blankLine" : " always" ,
19
+ " prev" : " var" ,
20
+ " next" : " return"
21
+ }
22
+ ]
23
+ }
24
+ ```
25
+
26
+ ``` jsonc
27
+ {
28
+ // Example - Add blank lines before interface and type definitions.
29
+ // note you must disable the base rule as it can report incorrect errors
30
+ " padding-line-between-statements" : " off" ,
31
+ " @typescript-eslint/padding-line-between-statements" : [
32
+ " error" ,
33
+ {
34
+ " blankLine" : " always" ,
35
+ " prev" : " *" ,
36
+ " next" : [" interface" , " type" ]
37
+ }
38
+ ]
39
+ }
40
+ ```
41
+
42
+ ## Options
43
+
44
+ See [ ` eslint/padding-line-between-statements ` options] ( https://eslint.org/docs/rules/padding-line-between-statements#options ) .
45
+
46
+ ** Note** - In addition to options provided by ESLint, we have also added options for ` interface ` and ` type ` .
47
+
48
+ <sup >Taken with ❤️ [ from ESLint core] ( https://github.com/eslint/eslint/blob/master/docs/rules/padding-line-between-statements.md ) </sup >
Original file line number Diff line number Diff line change @@ -116,6 +116,8 @@ export = {
116
116
'@typescript-eslint/non-nullable-type-assertion-style' : 'error' ,
117
117
'object-curly-spacing' : 'off' ,
118
118
'@typescript-eslint/object-curly-spacing' : 'error' ,
119
+ 'padding-line-between-statements' : 'off' ,
120
+ '@typescript-eslint/padding-line-between-statements' : 'error' ,
119
121
'@typescript-eslint/prefer-as-const' : 'error' ,
120
122
'@typescript-eslint/prefer-enum-initializers' : 'error' ,
121
123
'@typescript-eslint/prefer-for-of' : 'error' ,
Original file line number Diff line number Diff line change @@ -81,6 +81,7 @@ import noUselessConstructor from './no-useless-constructor';
81
81
import noVarRequires from './no-var-requires' ;
82
82
import nonNullableTypeAssertionStyle from './non-nullable-type-assertion-style' ;
83
83
import objectCurlySpacing from './object-curly-spacing' ;
84
+ import paddingLineBetweenStatements from './padding-line-between-statements' ;
84
85
import preferAsConst from './prefer-as-const' ;
85
86
import preferEnumInitializers from './prefer-enum-initializers' ;
86
87
import preferForOf from './prefer-for-of' ;
@@ -200,6 +201,7 @@ export default {
200
201
'no-var-requires' : noVarRequires ,
201
202
'non-nullable-type-assertion-style' : nonNullableTypeAssertionStyle ,
202
203
'object-curly-spacing' : objectCurlySpacing ,
204
+ 'padding-line-between-statements' : paddingLineBetweenStatements ,
203
205
'prefer-as-const' : preferAsConst ,
204
206
'prefer-enum-initializers' : preferEnumInitializers ,
205
207
'prefer-for-of' : preferForOf ,
You can’t perform that action at this time.
0 commit comments