Skip to content

Commit c06cb8e

Browse files
committed
Update lint config
1 parent 138d30b commit c06cb8e

File tree

5 files changed

+13
-19
lines changed

5 files changed

+13
-19
lines changed

.oxlintrc.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
{
22
"settings": {},
33
"rules": {
4-
"@typescript-eslint/no-extraneous-class": "allow",
54
"@typescript-eslint/no-this-alias": ["deny"],
6-
"unicorn/consistent-function-scoping": "allow",
75
"unicorn/no-empty-file": "allow",
86
"unicorn/no-new-array": "allow",
9-
"no-async-endpoint-handlers": "allow",
10-
"no-await-in-loop": "allow",
117
"no-control-regex": "allow",
12-
"no-extend-native": "allow",
13-
"no-new": "allow",
148
"no-self-assign": "allow",
159
"no-unused-vars": "allow"
1610
}

eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const sharedRules = {
2222
'no-control-regex': ['error'],
2323
'no-new': ['error'],
2424
'no-warning-comments': ['warn', { terms: ['fixme'] }],
25-
'unicorn/consistent-function-scoping': 'off'
25+
'unicorn/consistent-function-scoping': ['error']
2626
}
2727

2828
module.exports = [

src/commands/login.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ const flags: { [key: string]: any } = {
3838
}
3939
}
4040

41+
function nonNullish<T>(value: T | null | undefined): value is T {
42+
return value !== null && value !== undefined
43+
}
44+
4145
export const login: CliSubcommand = {
4246
description,
4347
async run(argv, importMeta, { parentName }) {
@@ -110,9 +114,6 @@ export const login: CliSubcommand = {
110114
return
111115
}
112116

113-
const nonNullish = <T>(value: T | null | undefined): value is T =>
114-
value != null
115-
116117
const enforcedChoices: OrgChoices = Object.values(orgs.organizations)
117118
.filter(nonNullish)
118119
.filter(org => org.plan === 'enterprise')

src/utils/package-manager-detector.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,19 @@ type ReadLockFile = (
9090
) => Promise<string | undefined>
9191

9292
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) => {
101100
try {
102101
return await reader(lockPath, agentExecPath)
103102
} catch {}
104103
return undefined
105104
}
105+
}
106106
return {
107107
bun: wrapReader(async (lockPath: string, agentExecPath: string) => {
108108
let lockBuffer: Buffer | undefined

test/path-resolve.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import nock from 'nock'
88
import { getPackageFiles } from './dist/path-resolve'
99

1010
const testPath = __dirname
11-
const rootPath = path.resolve(__dirname, '..')
1211
const mockPath = path.join(testPath, 'mock')
1312

1413
const globPatterns = {

0 commit comments

Comments
 (0)