fix: allow ignored-only staged lint
This commit is contained in:
@@ -15,7 +15,7 @@ pre-commit:
|
|||||||
glob: '*.{ts,tsx,mts,cts,mjs}'
|
glob: '*.{ts,tsx,mts,cts,mjs}'
|
||||||
exclude:
|
exclude:
|
||||||
- 'vendor/*/src/**'
|
- 'vendor/*/src/**'
|
||||||
run: node_modules/.bin/oxlint --fix {staged_files}
|
run: node_modules/.bin/oxlint --fix --no-error-on-unmatched-pattern {staged_files}
|
||||||
stage_fixed: true
|
stage_fixed: true
|
||||||
|
|
||||||
- name: whitespace (staged)
|
- name: whitespace (staged)
|
||||||
|
|||||||
@@ -210,6 +210,17 @@ export const longProbe = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 +
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('accepts an ignored-only staged selection', () => {
|
||||||
|
const result = runOxlint([
|
||||||
|
'--fix',
|
||||||
|
'--no-error-on-unmatched-pattern',
|
||||||
|
'scripts/install-lefthook.mjs',
|
||||||
|
])
|
||||||
|
|
||||||
|
expect(result.error).toBeUndefined()
|
||||||
|
expect(result.status, normalizedOutput(result)).toBe(0)
|
||||||
|
})
|
||||||
|
|
||||||
it('applies staged stylistic fixes before Oxlint validation', async () => {
|
it('applies staged stylistic fixes before Oxlint validation', async () => {
|
||||||
const suffix = randomUUID()
|
const suffix = randomUUID()
|
||||||
const configPath = await writeContractConfig(suffix)
|
const configPath = await writeContractConfig(suffix)
|
||||||
|
|||||||
Reference in New Issue
Block a user