CI: add TS indentation check via esLint (#24810)

This commit is contained in:
Yongtao Huang
2025-09-01 15:31:59 +08:00
committed by GitHub
parent 414ee51975
commit 208ce4e774
118 changed files with 457 additions and 489 deletions

View File

@@ -621,7 +621,7 @@ export default translation
&& !trimmed.startsWith('//'))
break
}
else {
else {
break
}

View File

@@ -60,7 +60,7 @@ describe('Description Validation Logic', () => {
try {
validateDescriptionLength(invalidDescription)
}
catch (error) {
catch (error) {
expect((error as Error).message).toBe(expectedErrorMessage)
}
})
@@ -86,7 +86,7 @@ describe('Description Validation Logic', () => {
expect(() => validateDescriptionLength(testDescription)).not.toThrow()
expect(validateDescriptionLength(testDescription)).toBe(testDescription)
}
else {
else {
expect(() => validateDescriptionLength(testDescription)).toThrow(
'Description cannot exceed 400 characters.',
)

View File

@@ -39,7 +39,7 @@ describe('Document List Sorting', () => {
const result = aValue.localeCompare(bValue)
return order === 'asc' ? result : -result
}
else {
else {
const result = aValue - bValue
return order === 'asc' ? result : -result
}

View File

@@ -196,7 +196,7 @@ describe('Plugin Tool Workflow Integration', () => {
const _pluginId = (tool.uniqueIdentifier as any).split(':')[0]
}).toThrow()
}
else {
else {
// Valid tools should work fine
expect(() => {
const _pluginId = tool.uniqueIdentifier.split(':')[0]

View File

@@ -252,7 +252,7 @@ describe('Real Browser Environment Dark Mode Flicker Test', () => {
if (hasStyleChange)
console.log('⚠️ Style changes detected - this causes visible flicker')
else
else
console.log('✅ No style changes detected')
expect(timingData.length).toBeGreaterThan(1)

View File

@@ -15,7 +15,7 @@ const originalEnv = process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT
function setupEnvironment(value?: string) {
if (value)
process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT = value
else
else
delete process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT
// Clear module cache to force re-evaluation
@@ -25,7 +25,7 @@ function setupEnvironment(value?: string) {
function restoreEnvironment() {
if (originalEnv)
process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT = originalEnv
else
else
delete process.env.NEXT_PUBLIC_MAX_PARALLEL_LIMIT
jest.resetModules()