8000 feat(operator-linebreak): support TS Nodes (#805) · eslint-stylistic/eslint-stylistic@d7ab8d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit d7ab8d2

Browse files
9romiseautofix-ci[bot]antfu
authored
feat(operator-linebreak): support TS Nodes (#805)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Anthony Fu <github@antfu.me>
1 parent f80f38a commit d7ab8d2

File tree

78 files changed

+1303
-673
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+1303
-673
lines changed

packages/eslint-plugin/rules/array-bracket-newline/types.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
/* @checksum: WKQe0orC7z285Xaajj2oQmnoj_l63UyKP_jh9x_fBfs */
44

5-
export type ArrayBracketNewlineSchema0 =
6-
| ('always' | 'never' | 'consistent')
7-
| {
8-
multiline?: boolean
9-
minItems?: number | null
10-
}
5+
export type ArrayBracketNewlineSchema0
6+
= | ('always' | 'never' | 'consistent')
7+
| {
8+
multiline?: boolean
9+
minItems?: number | null
10+
}
1111

1212
export type ArrayBracketNewlineRuleOptions = [
1313
ArrayBracketNewlineSchema0?,
1414
]
1515

1616
export type RuleOptions = ArrayBracketNewlineRuleOptions
17-
export type MessageIds =
18-
| 'unexpectedOpeningLinebreak'
19-
| 'unexpectedClosingLinebreak'
20-
| 'missingOpeningLinebreak'
21-
| 'missingClosingLinebreak'
17+
export type MessageIds
18+
= | 'unexpectedOpeningLinebreak'
19+
| 'unexpectedClosingLinebreak'
20+
| 'missingOpeningLinebreak'
21+
| 'missingClosingLinebreak'

packages/eslint-plugin/rules/array-bracket-spacing/types.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line nu 10000 mberDiff line change
@@ -16,8 +16,8 @@ export type ArrayBracketSpacingRuleOptions = [
1616
]
1717

1818
export type RuleOptions = ArrayBracketSpacingRuleOptions
19-
export type MessageIds =
20-
| 'unexpectedSpaceAfter'
21-
| 'unexpectedSpaceBefore'
22-
| 'missingSpaceAfter'
23-
| 'missingSpaceBefore'
19+
export type MessageIds
20+
= | 'unexpectedSpaceAfter'
21+
| 'unexpectedSpaceBefore'
22+
| 'missingSpaceAfter'
23+
| 'missingSpaceBefore'

packages/eslint-plugin/rules/array-element-newline/types.d.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,27 @@
22

33
/* @checksum: 1kqicJNR6UJ01t-i0W7IpZH0Y6o2mmVBx21O6mt87R4 */
44

5-
export type ArrayElementNewlineSchema0 =
6-
| []
7-
| [
8-
| BasicConfig
5+
export type ArrayElementNewlineSchema0
6+
= | []
7+
| [
8+
| BasicConfig
9+
| {
10+
ArrayExpression?: BasicConfig
11+
ArrayPattern?: BasicConfig
12+
},
13+
]
14+
export type BasicConfig
15+
= | ('always' | 'never' | 'consistent')
916
| {
10-
ArrayExpression?: BasicConfig
11-
ArrayPattern?: BasicConfig
12-
},
13-
]
14-
export type BasicConfig =
15-
| ('always' | 'never' | 'consistent')
16-
| {
17-
consistent?: boolean
18-
multiline?: boolean
19-
minItems?: number | null
20-
}
17+
consistent?: boolean
18+
multiline?: boolean
19+
minItems?: number | null
20+
}
2121

22-
export type ArrayElementNewlineRuleOptions =
23-
ArrayElementNewlineSchema0
22+
export type ArrayElementNewlineRuleOptions
23+
= ArrayElementNewlineSchema0
2424

2525
export type RuleOptions = ArrayElementNewlineRuleOptions
26-
export type MessageIds =
27-
| 'unexpectedLineBreak'
28-
| 'missingLineBreak'
26+
export type MessageIds
27+
= | 'unexpectedLineBreak'
28+
| 'missingLineBreak'

packages/eslint-plugin/rules/arrow-parens/types.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ export type ArrowParensRuleOptions = [
1414
]
1515

1616
export type RuleOptions = ArrowParensRuleOptions
17-
export type MessageIds =
18-
| 'unexpectedParens'
19-
| 'expectedParens'
20-
| 'unexpectedParensInline'
21-
| 'expectedParensBlock'
17+
export type MessageIds
18+
= | 'unexpectedParens'
19+
| 'expectedParens'
20+
| 'unexpectedParensInline'
21+
| 'expectedParensBlock'

packages/eslint-plugin/rules/arrow-spacing/types.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ export interface ArrowSpacingSchema0 {
1010
export type ArrowSpacingRuleOptions = [ArrowSpacingSchema0?]
1111

1212
export type RuleOptions = ArrowSpacingRuleOptions
13-
export type MessageIds =
14-
| 'expectedBefore'
15-
| 'unexpectedBefore'
16-
| 'expectedAfter'
17-
| 'unexpectedAfter'
13+
export type MessageIds
14+
= | 'expectedBefore'
15+
| 'unexpectedBefore'
16+
| 'expectedAfter'
17+
| 'unexpectedAfter'

packages/eslint-plugin/rules/brace-style/types.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
/* @checksum: x-zK6lKOyxz2s9YQ6AWlku2z-BN7szEb1dTLyY20Z1Y */
44

5-
export type BraceStyleSchema0 =
6-
| '1tbs'
7-
| 'stroustrup'
8-
| 'allman'
5+
export type BraceStyleSchema0
6+
= | '1tbs'
7+
| 'stroustrup'
8+
| 'allman'
99

1010
export interface BraceStyleSchema1 {
1111
allowSingleLine?: boolean
@@ -17,10 +17,10 @@ export type BraceStyleRuleOptions = [
1717
]
1818

1919
export type RuleOptions = BraceStyleRuleOptions
20-
export type MessageIds =
21-
| 'nextLineOpen'
22-
| 'sameLineOpen'
23-
| 'blockSameLine'
24-
| 'nextLineClose'
25-
| 'singleLineClose'
26-
| 'sameLineClose'
20+
export type MessageIds
21+
= | 'nextLineOpen'
22+
| 'sameLineOpen'
23+
| 'blockSameLine'
24+
| 'nextLineClose'
25+
| 'singleLineClose'
26+
| 'sameLineClose'

packages/eslint-plugin/rules/comma-dangle/comma-dangle.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ const OPTION_VALUE_SCHEME = [
1818
'only-multiline',
1919
]
2020

21-
type TargetASTNode =
22-
| Tree.ArrayExpression
23-
| Tree.ArrayPattern
24-
| Tree.ObjectExpression
25-
| Tree.ObjectPattern
26-
| Tree.ImportDeclaration
27-
| Tree.ExportNamedDeclaration
28-
| Tree.FunctionDeclaration
29-
| Tree.FunctionExpression
30-
| Tree.ArrowFunctionExpression
31-
| Tree.CallExpression
32-
| Tree.NewExpression
33-
| Tree.ImportExpression
34-
| Tree.ExportAllDeclaration
35-
| Tree.TSEnumDeclaration
36-
| Tree.TSTypeParameterDeclaration
37-
| Tree.TSTupleType
21+
type TargetASTNode
22+
= | Tree.ArrayExpression
23+
| Tree.ArrayPattern
24+
| Tree.ObjectExpression
25+
| Tree.ObjectPattern
26+
| Tree.ImportDeclaration
27+
| Tree.ExportNamedDeclaration
28+
| Tree.FunctionDeclaration
29+
| Tree.FunctionExpression
30+
| Tree.ArrowFunctionExpression
31+
| Tree.CallExpression
32+
| Tree.NewExpression
33+
| Tree.ImportExpression
34+
| Tree.ExportAllDeclaration
35+
| Tree.TSEnumDeclaration
36+
| Tree.TSTypeParameterDeclaration
37+
| Tree.TSTupleType
3838

3939
type ItemASTNode = NonNullable<
4040
| Tree.ObjectLiteralElement

packages/eslint-plugin/rules/comma-dangle/types.d.ts

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,34 @@
22

33
/* @checksum: VHP0Hfjl83aHxTkqUSDkQX0JRqc88wY3GCFUKNpaObg */
44

5-
export type CommaDangleSchema0 =
6-
| []
7-
| [
8-
| Value
9-
| {
10-
arrays?: ValueWithIgnore
11-
objects?: ValueWithIgnore
12-
imports?: ValueWithIgnore
13-
exports?: ValueWithIgnore
14-
functions?: ValueWithIgnore
15-
importAttributes?: ValueWithIgnore
16-
dynamicImports?: ValueWithIgnore
17-
enums?: ValueWithIgnore
18-
generics?: ValueWithIgnore
19-
tuples?: ValueWithIgnore
20-
},
21-
]
22-
export type Value =
23-
| 'always-multiline'
24-
| 'always'
25-
| 'never'
26-
| 'only-multiline'
27-
export type ValueWithIgnore =
28-
| 'always-multiline'
29-
| 'always'
30-
| 'never'
31-
| 'only-multiline'
32-
| 'ignore'
5+
export type CommaDangleSchema0
6+
= | []
7+
| [
8+
| Value
9+
| {
10+
arrays?: ValueWithIgnore
11+
objects?: ValueWithIgnore
12+
imports?: ValueWithIgnore
13+
exports?: ValueWithIgnore
14+
functions?: ValueWithIgnore
15+
importAttributes?: ValueWithIgnore
16+
dynamicImports?: ValueWithIgnore
17+
enums?: ValueWithIgnore
18+
generics?: ValueWithIgnore
19+
tuples?: ValueWithIgnore
20+
},
21+
]
22+
export type Value
23+
= | 'always-multiline'
24+
| 'always'
25+
| 'never'
26+
| 'only-multiline'
27+
export type ValueWithIgnore
28+
= | 'always-multiline'
29+
| 'always'
30+
| 'never'
31+
| 'only-multiline'
32+
| 'ignore'
3333

3434
export type CommaDangleRuleOptions = CommaDangleSchema0
3535

packages/eslint-plugin/rules/comma-style/comma-style._js_.ts

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -260,39 +260,39 @@ export default createRule<RuleOptions, MessageIds>({
260260
})
261261
}
262262

263-
type NodeType =
264-
| Tree.VariableDeclaration
265-
| Tree.ArrayExpression
266-
| Tree.ObjectExpression
267-
| Tree.ObjectPattern
268-
| Tree.ArrayPattern
269-
| Tree.FunctionDeclaration
270-
| Tree.FunctionExpression
271-
| Tree.CallExpression
272-
| Tree.ImportDeclaration
273-
| Tree.NewExpression
274-
| Tree.ArrowFunctionExpression
275-
| Tree.ExportAllDeclaration
276-
| Tree.ExportNamedDeclaration
277-
| Tree.ImportExpression
278-
| Tree.SequenceExpression
279-
| Tree.ClassDeclaration
280-
| Tree.ClassExpression
281-
| Tree.TSDeclareFunction
282-
| Tree.TSFunctionType
283-
| Tree.TSConstructorType
284-
| Tree.TSEmptyBodyFunctionExpression
285-
| Tree.TSEnumBody
286-
| Tree.TSTypeLiteral
287-
| Tree.TSIndexSignature
288-
| Tree.TSMethodSignature
289-
| Tree.TSCallSignatureDeclaration
290-
| Tree.TSConstructSignatureDeclaration
291-
| Tree.TSInterfaceBody
292-
| Tree.TSInterfaceDeclaration
293-
| Tree.TSTupleType
294-
| Tree.TSTypeParameterDeclaration
295-
| Tree.TSTypeParameterInstantiation
263+
type NodeType
264+
= | Tree.VariableDeclaration
265+
| Tree.ArrayExpression
266+
| Tree.ObjectExpression
267+
| Tree.ObjectPattern
268+
| Tree.ArrayPattern
269+
| Tree.FunctionDeclaration
270+
| Tree.FunctionExpression
271+
| Tree.CallExpression
272+
| Tree.ImportDeclaration
273+
| Tree.NewExpression
274+
| Tree.ArrowFunctionExpression
275+
| Tree.ExportAllDeclaration
276+
| Tree.ExportNamedDeclaration
277+
| Tree.ImportExpression
278+
| Tree.SequenceExpression
279+
| Tree.ClassDeclaration
280+
| Tree.ClassExpression
281+
| Tree.TSDeclareFunction
282+
| Tree.TSFunctionType
283+
| Tree.TSConstructorType
284+
| Tree.TSEmptyBodyFunctionExpression
285+
| Tree.TSEnumBody
286+
| Tree.TSTypeLiteral
287+
| Tree.TSIndexSignature
288+
| Tree.TSMethodSignature
289+
| Tree.TSCallSignatureDeclaration
290+
| Tree.TSConstructSignatureDeclaration
291+
| Tree.TSInterfaceBody
292+
| Tree.TSInterfaceDeclaration
293+
| Tree.TSTupleType
294+
| Tree.TSTypeParameterDeclaration
295+
| Tree.TSTypeParameterInstantiation
296296

297297
const nodes: RuleListener = {}
298298

packages/eslint-plugin/rules/comma-style/types.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export type CommaStyleRuleOptions = [
1616
]
1717

1818
export type RuleOptions = CommaStyleRuleOptions
19-
export type MessageIds =
20-
| 'unexpectedLineBeforeAndAfterComma'
21-
| 'expectedCommaFirst'
22-
| 'expectedCommaLast'
19+
export type MessageIds
20+
= | 'unexpectedLineBeforeAndAfterComma'
21+
| 'expectedCommaFirst'
22+
| 'expectedCommaLast'

0 commit comments

Comments
 (0)
0