🎨 style(vscode): eslint 自动修复格式与排序
Claude-Session: https://claude.ai/code/session_01HTMgwaE3woqM5yvsHiuSAa
This commit is contained in:
1 parent
df35bcfd49
commit
8c22a29ce5
41 files changed
+248
-167
No files matched your search
@@ -34,24 +34,24 @@ describe('resolveClaudeBin', () => {
|
||||
expect(resolveClaudeBin({ PATH: dir }, '/no-such-home')).toBe(bin)
|
||||
})
|
||||
|
||||
it('PATH 未命中时回退到 $HOME/.local/bin/claude', () => {
|
||||
it('pATH 未命中时回退到 $HOME/.local/bin/claude', () => {
|
||||
const home = tempDir()
|
||||
const bin = touchClaude(path.join(home, '.local', 'bin'))
|
||||
expect(resolveClaudeBin({ PATH: '' }, home)).toBe(bin)
|
||||
})
|
||||
|
||||
it('PATH 未命中时回退到 $HOME/.claude/local/claude', () => {
|
||||
it('pATH 未命中时回退到 $HOME/.claude/local/claude', () => {
|
||||
const home = tempDir()
|
||||
const bin = touchClaude(path.join(home, '.claude', 'local'))
|
||||
expect(resolveClaudeBin({ PATH: '' }, home)).toBe(bin)
|
||||
})
|
||||
|
||||
it('PATH 与候选皆空 → null', () => {
|
||||
it('pATH 与候选皆空 → null', () => {
|
||||
const home = tempDir()
|
||||
expect(resolveClaudeBin({ PATH: '' }, home)).toBeNull()
|
||||
})
|
||||
|
||||
it('PATH 中目录不存在时跳过并继续', () => {
|
||||
it('pATH 中目录不存在时跳过并继续', () => {
|
||||
const home = tempDir()
|
||||
const bin = touchClaude(path.join(home, '.local', 'bin'))
|
||||
expect(resolveClaudeBin({ PATH: '/definitely/missing/bin' }, home)).toBe(bin)
|
||||
|
||||
@@ -169,13 +169,11 @@ export async function watchForNewCodexSession(opts: {
|
||||
})
|
||||
})
|
||||
watcher.on('error', (err) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[superpowers] codexSessionWatcher: watch error', err)
|
||||
done(null)
|
||||
})
|
||||
}
|
||||
catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[superpowers] codexSessionWatcher: fs.watch threw', err)
|
||||
done(null)
|
||||
return
|
||||
|
||||
@@ -57,7 +57,7 @@ describe('resolveCommitProfileForRun', () => {
|
||||
const result = resolveCommitProfileForRun(
|
||||
missing,
|
||||
p => p,
|
||||
p => {
|
||||
(p) => {
|
||||
try {
|
||||
accessSync(p, constants.R_OK)
|
||||
return true
|
||||
@@ -77,7 +77,7 @@ describe('resolveCommitProfileForRun', () => {
|
||||
const result = resolveCommitProfileForRun(
|
||||
file,
|
||||
p => p,
|
||||
p => {
|
||||
(p) => {
|
||||
try {
|
||||
accessSync(p, constants.R_OK)
|
||||
return true
|
||||
@@ -98,7 +98,7 @@ describe('resolveCommitProfileForRun', () => {
|
||||
const result = resolveCommitProfileForRun(
|
||||
foreign,
|
||||
() => local,
|
||||
p => {
|
||||
(p) => {
|
||||
try {
|
||||
accessSync(p, constants.R_OK)
|
||||
return true
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import type { PrDiffMode } from './prDiffMode'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
DEFAULT_PR_DIFF_MODE,
|
||||
isPrDiffMode,
|
||||
parsePrDiffMode,
|
||||
type PrDiffMode,
|
||||
|
||||
} from './prDiffMode'
|
||||
|
||||
describe('DEFAULT_PR_DIFF_MODE', () => {
|
||||
describe('dEFAULT_PR_DIFF_MODE', () => {
|
||||
it('默认是 unified', () => {
|
||||
expect(DEFAULT_PR_DIFF_MODE).toBe('unified')
|
||||
})
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { accessSync, constants, mkdtempSync, mkdirSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { accessSync, constants, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import * as os from 'node:os'
|
||||
import * as path from 'node:path'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
|
||||
@@ -35,7 +35,6 @@ export async function watchForNewSession(opts: {
|
||||
snapshot = new Set(existing.filter(n => n.endsWith('.jsonl')))
|
||||
}
|
||||
catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[superpowers] sessionWatcher: readdir failed', err)
|
||||
return null
|
||||
}
|
||||
@@ -89,13 +88,11 @@ export async function watchForNewSession(opts: {
|
||||
})
|
||||
})
|
||||
watcher.on('error', (err) => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[superpowers] sessionWatcher: watch error', err)
|
||||
done(null)
|
||||
})
|
||||
}
|
||||
catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[superpowers] sessionWatcher: fs.watch threw', err)
|
||||
done(null)
|
||||
return
|
||||
@@ -131,7 +128,6 @@ export async function pollForNewSession(opts: {
|
||||
snapshot = new Set(existing.filter(n => n.endsWith('.jsonl')))
|
||||
}
|
||||
catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn('[superpowers] sessionWatcher: poll readdir failed', err)
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -105,7 +105,6 @@ function extractClaudePayload(stdout: string): ParsedClaudeJson | null {
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
function truncateDiagnostic(text: string): string {
|
||||
if (text.length <= EXIT_DIAGNOSTIC_MAX_CHARS)
|
||||
return text
|
||||
|
||||
Reference in new issue
Block a user