File tree 5 files changed +12
-8
lines changed
5 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,6 @@ module.exports = {
9
9
'plugin:@typescript-eslint/eslint-recommended' ,
10
10
'plugin:@typescript-eslint/recommended' ,
11
11
'prettier' ,
12
- 'prettier/@typescript-eslint' ,
13
12
] ,
14
13
root : true ,
15
14
env : {
@@ -22,5 +21,10 @@ module.exports = {
22
21
'@typescript-eslint/no-explicit-any' : 'off' ,
23
22
'@typescript-eslint/no-use-before-define' : 'off' ,
24
23
'@typescript-eslint/no-non-null-assertion' : 'off' ,
24
+ '@typescript-eslint/ban-types' : [ 'error' , {
25
+ 'types' : {
26
+ 'Function' : false ,
27
+ }
28
+ } ] ,
25
29
} ,
26
30
} ;
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import {
11
11
export const InjectRepository = (
12
12
entity : EntityClassOrSchema ,
13
13
connection : string = DEFAULT_CONNECTION_NAME ,
14
- ) => Inject ( getRepositoryToken ( entity , connection ) ) ;
14
+ ) : ReturnType < typeof Inject > => Inject ( getRepositoryToken ( entity , connection ) ) ;
15
15
16
16
export const InjectConnection : (
17
17
connection ?: Connection | ConnectionOptions | string ,
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ const logger = new Logger('TypeOrmModule');
25
25
export function getRepositoryToken (
26
26
entity : EntityClassOrSchema ,
27
27
connection : Connection | ConnectionOptions | string = DEFAULT_CONNECTION_NAME ,
28
- ) {
28
+ ) : Function | string {
29
29
if ( entity === null || entity === undefined ) {
30
30
throw new CircularDependencyException ( '@InjectRepository()' ) ;
31
31
}
@@ -54,7 +54,7 @@ export function getRepositoryToken(
54
54
* @param {Function } This parameter can either be an Entity or Repository
55
55
* @returns {string } The Repository injection token
56
56
*/
57
- export function getCustomRepositoryToken ( repository : Function ) {
57
+ export function getCustomRepositoryToken ( repository : Function ) : string {
58
58
if ( repository === null || repository === undefined ) {
59
59
throw new CircularDependencyException ( '@InjectRepository()' ) ;
60
60
}
@@ -157,8 +157,8 @@ export function handleRetry(
157
157
) ;
158
158
}
159
159
160
- export function getConnectionName ( options : ConnectionOptions ) {
160
+ export function getConnectionName ( options : ConnectionOptions ) : string {
161
161
return options && options . name ? options . name : DEFAULT_CONNECTION_NAME ;
162
162
}
163
163
164
- export const generateString = ( ) => uuid ( ) ;
164
+ export const generateString = ( ) : string => uuid ( ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ export class EntitiesMetadataStorage {
9
9
static addEntitiesByConnection (
10
10
connection : ConnectionToken ,
11
11
entities : EntityClassOrSchema [ ] ,
12
- ) {
12
+ ) : void {
13
13
const connectionToken =
14
14
typeof connection === 'string' ? connection : connection . name ;
15
15
if ( ! connectionToken ) {
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ export class TypeOrmCoreModule implements OnApplicationShutdown {
109
109
} ;
110
110
}
111
111
112
- async onApplicationShutdown ( ) {
112
+ async onApplicationShutdown ( ) : Promise < void > {
113
113
if ( this . options . keepConnectionAlive ) {
114
114
return ;
115
115
}
You can’t perform that action at this time.
0 commit comments