Skip to content

Commit

Permalink
refactor: update groups in ts types
Browse files Browse the repository at this point in the history
  • Loading branch information
azat-io committed Jul 20, 2024
1 parent 92ad404 commit ba31478
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
13 changes: 11 additions & 2 deletions rules/sort-intersection-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
case 'TSConditionalType':
defineGroup('conditional')
break
case 'TSConstructorType':
case 'TSFunctionType':
defineGroup('function')
break
Expand All @@ -135,17 +136,24 @@ export default createEslintRule<Options, MESSAGE_ID>({
case 'TSNumberKeyword':
case 'TSObjectKeyword':
case 'TSStringKeyword':
case 'TSSymbolKeyword':
case 'TSThisType':
case 'TSUnknownKeyword':
case 'TSVoidKeyword':
case 'TSIntrinsicKeyword':
defineGroup('keyword')
break
case 'TSLiteralType':
case 'TSTemplateLiteralType':
defineGroup('literal')
break
case 'TSTypeReference':
case 'TSArrayType':
case 'TSIndexedAccessType':
case 'TSInferType':
case 'TSTypeReference':
case 'TSQualifiedName':
defineGroup('named')
break
case 'TSMappedType':
case 'TSTypeLiteral':
defineGroup('object')
break
Expand All @@ -161,6 +169,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
break
case 'TSNullKeyword':
case 'TSUndefinedKeyword':
case 'TSVoidKeyword':
defineGroup('nullish')
break
}
Expand Down
13 changes: 11 additions & 2 deletions rules/sort-union-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
case 'TSConditionalType':
defineGroup('conditional')
break
case 'TSConstructorType':
case 'TSFunctionType':
defineGroup('function')
break
Expand All @@ -135,17 +136,24 @@ export default createEslintRule<Options, MESSAGE_ID>({
case 'TSNumberKeyword':
case 'TSObjectKeyword':
case 'TSStringKeyword':
case 'TSSymbolKeyword':
case 'TSThisType':
case 'TSUnknownKeyword':
case 'TSVoidKeyword':
case 'TSIntrinsicKeyword':
defineGroup('keyword')
break
case 'TSLiteralType':
case 'TSTemplateLiteralType':
defineGroup('literal')
break
case 'TSTypeReference':
case 'TSArrayType':
case 'TSIndexedAccessType':
case 'TSInferType':
case 'TSTypeReference':
case 'TSQualifiedName':
defineGroup('named')
break
case 'TSMappedType':
case 'TSTypeLiteral':
defineGroup('object')
break
Expand All @@ -161,6 +169,7 @@ export default createEslintRule<Options, MESSAGE_ID>({
break
case 'TSNullKeyword':
case 'TSUndefinedKeyword':
case 'TSVoidKeyword':
defineGroup('nullish')
break
}
Expand Down

0 comments on commit ba31478

Please sign in to comment.