File tree Expand file tree Collapse file tree 5 files changed +127
-133
lines changed Expand file tree Collapse file tree 5 files changed +127
-133
lines changed Original file line number Diff line number Diff line change 85
85
"@types/jest" : " ^29.0.0" ,
86
86
"@types/node" : " ^16.0.0" ,
87
87
"@types/semver" : " ^7.5.8" ,
88
- "@typescript-eslint/eslint-plugin" : " ^7 .0.0" ,
89
- "@typescript-eslint/parser" : " ^7 .0.0" ,
90
- "@typescript-eslint/utils" : " ^7 .0.0" ,
88
+ "@typescript-eslint/eslint-plugin" : " ^8 .0.0" ,
89
+ "@typescript-eslint/parser" : " ^8 .0.0" ,
90
+ "@typescript-eslint/utils" : " ^8 .0.0" ,
91
91
"babel-jest" : " ^29.0.0" ,
92
92
"babel-plugin-replace-ts-export-assignment" : " ^0.0.2" ,
93
93
"dedent" : " ^1.5.0" ,
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ export default createRule({
117
117
if ( importNode ?. type === AST_NODE_TYPES . ImportDeclaration ) {
118
118
for ( const specifier of importNode . specifiers ) {
119
119
if ( specifier . type === AST_NODE_TYPES . ImportSpecifier ) {
120
- let importName = specifier . imported . name ?? '' ;
120
+ let importName =
121
+ 'name' in specifier . imported ? specifier . imported . name : '' ;
121
122
const local = getAccessorValue ( specifier . local ) ;
122
123
123
124
if ( local !== importName ) {
Original file line number Diff line number Diff line change @@ -48,6 +48,14 @@ export type MessageIds = 'unbound' | 'unboundWithoutThisAnnotation';
48
48
49
49
const DEFAULT_MESSAGE = 'This rule requires `@typescript-eslint/eslint-plugin`' ;
50
50
51
+ // todo: remove these along with the actual runtime properties below in new major
52
+ declare module '@typescript-eslint/utils/ts-eslint' {
53
+ interface RuleMetaDataDocs {
54
+ requiresTypeChecking ?: boolean ;
55
+ recommended ?: unknown ;
56
+ }
57
+ }
58
+
51
59
export default createRule < Options , MessageIds > ( {
52
60
defaultOptions : [ { ignoreStatic : false } ] ,
53
61
...baseRule ,
Original file line number Diff line number Diff line change @@ -452,15 +452,12 @@ const describeImportDefAsImport = (
452
452
return null ;
453
453
}
454
454
455
- let imported = def . node . imported . name ?? '' ;
456
-
457
- if ( 'value' in def . node . imported ) {
458
- imported = def . node . imported . value as string ;
459
- }
460
-
461
455
return {
462
456
source : def . parent . source . value ,
463
- imported,
457
+ imported :
458
+ 'name' in def . node . imported
459
+ ? def . node . imported . name
460
+ : def . node . imported . value ,
464
461
local : def . node . local . name ,
465
462
} ;
466
463
} ;
You can’t perform that action at this time.
0 commit comments