File tree Expand file tree Collapse file tree 5 files changed +13
-19
lines changed Expand file tree Collapse file tree 5 files changed +13
-19
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"settings" : {},
3
3
"rules" : {
4
- "@typescript-eslint/no-extraneous-class" : " allow" ,
5
4
"@typescript-eslint/no-this-alias" : [" deny" ],
6
- "unicorn/consistent-function-scoping" : " allow" ,
7
5
"unicorn/no-empty-file" : " allow" ,
8
6
"unicorn/no-new-array" : " allow" ,
9
- "no-async-endpoint-handlers" : " allow" ,
10
- "no-await-in-loop" : " allow" ,
11
7
"no-control-regex" : " allow" ,
12
- "no-extend-native" : " allow" ,
13
- "no-new" : " allow" ,
14
8
"no-self-assign" : " allow" ,
15
9
"no-unused-vars" : " allow"
16
10
}
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ const sharedRules = {
22
22
'no-control-regex' : [ 'error' ] ,
23
23
'no-new' : [ 'error' ] ,
24
24
'no-warning-comments' : [ 'warn' , { terms : [ 'fixme' ] } ] ,
25
- 'unicorn/consistent-function-scoping' : 'off'
25
+ 'unicorn/consistent-function-scoping' : [ 'error' ]
26
26
}
27
27
28
28
module . exports = [
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ const flags: { [key: string]: any } = {
38
38
}
39
39
}
40
40
41
+ function nonNullish < T > ( value : T | null | undefined ) : value is T {
42
+ return value !== null && value !== undefined
43
+ }
44
+
41
45
export const login : CliSubcommand = {
42
46
description,
43
47
async run ( argv , importMeta , { parentName } ) {
@@ -110,9 +114,6 @@ export const login: CliSubcommand = {
110
114
return
111
115
}
112
116
113
- const nonNullish = < T > ( value : T | null | undefined ) : value is T =>
114
- value != null
115
-
116
117
const enforcedChoices : OrgChoices = Object . values ( orgs . organizations )
117
118
. filter ( nonNullish )
118
119
. filter ( org => org . plan === 'enterprise' )
Original file line number Diff line number Diff line change @@ -90,19 +90,19 @@ type ReadLockFile = (
90
90
) => Promise < string | undefined >
91
91
92
92
const readLockFileByAgent : Record < AgentPlusBun , ReadLockFile > = ( ( ) => {
93
- const wrapReader =
94
- (
95
- reader : (
96
- lockPath : string ,
97
- agentExecPath : string
98
- ) => Promise < string | undefined >
99
- ) : ReadLockFile =>
100
- async ( lockPath : string , agentExecPath : string ) => {
93
+ function wrapReader (
94
+ reader : (
95
+ lockPath : string ,
96
+ agentExecPath : string
97
+ ) => Promise < string | undefined >
98
+ ) : ReadLockFile {
99
+ return async ( lockPath : string , agentExecPath : string ) => {
101
100
try {
102
101
return await reader ( lockPath , agentExecPath )
103
102
} catch { }
104
103
return undefined
105
104
}
105
+ }
106
106
return {
107
107
bun : wrapReader ( async ( lockPath : string , agentExecPath : string ) => {
108
108
let lockBuffer : Buffer | undefined
Original file line number Diff line number Diff line change @@ -8,7 +8,6 @@ import nock from 'nock'
8
8
import { getPackageFiles } from './dist/path-resolve'
9
9
10
10
const testPath = __dirname
11
- const rootPath = path . resolve ( __dirname , '..' )
12
11
const mockPath = path . join ( testPath , 'mock' )
13
12
14
13
const globPatterns = {
You can’t perform that action at this time.
0 commit comments