fix(quality-gate): let the changed-code gate see the focused import plugins (#20912)

import/no-duplicates was reachable only through the repo-wide CI audit, so an
author's first signal was a red static analysis job after push.
This commit is contained in:
Brennan Benson
2026-09-16 20:54:27 -07:00
committed by GitHub
parent c2962a765a
commit fbe7b194b8
2 changed files with 21 additions and 0 deletions
@@ -24,6 +24,17 @@ export const OXLINT_SCANS = [
label: 'casting code quality',
args: ['--config', 'config/oxlint-code-quality-casting.json']
},
{
// Why the allow: CI's `audit:code-quality:native` runs before the mobile install, so it can
// never see a cycle inside mobile/ — locally, where mobile/node_modules exists, it would.
label: 'focused plugins',
args: [
'--config',
'config/oxlint-code-quality-native-plugins.json',
'--allow',
'import/no-cycle'
]
},
{
label: 'type-aware code quality',
args: ['--type-aware', '--config', 'config/oxlint-code-quality-type-aware.json']
@@ -57,6 +57,16 @@ describe('changed-code quality line matching', () => {
expect(scan.args).not.toContain('--disable-nested-config')
})
// Why: import/no-duplicates was reachable only through the repo-wide CI audit, so it first
// surfaced after push. The cycle rule stays out because CI's audit runs before the mobile install.
it('runs the focused plugin config the repo-wide audit enforces, minus the cycle rule', () => {
const scan = OXLINT_SCANS.find((candidate) => candidate.label === 'focused plugins')
expect(scan.args).toContain('config/oxlint-code-quality-native-plugins.json')
expect(scan.args).toContain('import/no-cycle')
expect(scan.args[scan.args.indexOf('import/no-cycle') - 1]).toBe('--allow')
})
it('leaves Cloud source to the independent Cloud quality checks', () => {
expect(isRootCodeQualityPath('cloud/apps/relay/src/index.ts')).toBe(false)
expect(isRootCodeQualityPath('src/main/index.ts')).toBe(true)