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 8585 "@types/jest" : " ^29.0.0" ,
8686 "@types/node" : " ^16.0.0" ,
8787 "@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" ,
9191 "babel-jest" : " ^29.0.0" ,
9292 "babel-plugin-replace-ts-export-assignment" : " ^0.0.2" ,
9393 "dedent" : " ^1.5.0" ,
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ export default createRule({
117117 if ( importNode ?. type === AST_NODE_TYPES . ImportDeclaration ) {
118118 for ( const specifier of importNode . specifiers ) {
119119 if ( specifier . type === AST_NODE_TYPES . ImportSpecifier ) {
120- let importName = specifier . imported . name ?? '' ;
120+ let importName =
121+ 'name' in specifier . imported ? specifier . imported . name : '' ;
121122 const local = getAccessorValue ( specifier . local ) ;
122123
123124 if ( local !== importName ) {
Original file line number Diff line number Diff line change @@ -48,6 +48,14 @@ export type MessageIds = 'unbound' | 'unboundWithoutThisAnnotation';
4848
4949const DEFAULT_MESSAGE = 'This rule requires `@typescript-eslint/eslint-plugin`' ;
5050
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+
5159export default createRule < Options , MessageIds > ( {
5260 defaultOptions : [ { ignoreStatic : false } ] ,
5361 ...baseRule ,
Original file line number Diff line number Diff line change @@ -452,15 +452,12 @@ const describeImportDefAsImport = (
452452 return null ;
453453 }
454454
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-
461455 return {
462456 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 ,
464461 local : def . node . local . name ,
465462 } ;
466463} ;
You can’t perform that action at this time.
0 commit comments