Skip to content

Commit afd727c

Browse files
committed
chore(wheelhouse): cascade template@335f8677
Auto-applied by socket-wheelhouse sync-scaffolding into socket-bin. 4 file(s) touched: - .config/fleet/oxfmtrc.json - .config/fleet/oxlintrc.json - .gitattributes - scripts/fleet/lint.mts
1 parent d1a522f commit afd727c

4 files changed

Lines changed: 344 additions & 4 deletions

File tree

.config/fleet/oxfmtrc.json

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.config/fleet/oxlintrc.json

Lines changed: 269 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,9 @@ pnpm-lock.yaml -diff
109109
.config/fleet/.markdownlint-cli2.jsonc linguist-generated=true
110110
.config/fleet/.prettierignore linguist-generated=true
111111
.config/fleet/markdownlint-rules linguist-generated=true
112+
.config/fleet/oxfmtrc.json linguist-generated=true
112113
.config/fleet/oxlint-plugin linguist-generated=true
114+
.config/fleet/oxlintrc.json linguist-generated=true
113115
.config/fleet/sfw-bypass-list.txt linguist-generated=true
114116
.config/fleet/taze.config.mts linguist-generated=true
115117
.config/fleet/tsconfig.base.json linguist-generated=true

scripts/fleet/lint.mts

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,22 @@ const useShell = process.platform === 'win32'
4343

4444
const LINTABLE_EXTS = new Set(['.cjs', '.cts', '.js', '.mjs', '.mts', '.ts'])
4545

46+
// Two-file extends layout: `.config/fleet/<config>.json` is fleet-canonical
47+
// (byte-identical across the fleet, owned by the wheelhouse cascade).
48+
// A repo with overrides ships `.config/repo/<config>.json` that uses
49+
// `extends: ['../fleet/<config>.json']` + a small `overrides` block.
50+
// Auto-discover: prefer the repo overlay if it exists, else the fleet
51+
// canonical. Picks at invocation time — adding the overlay doesn't
52+
// require touching scripts. The basename (oxlintrc.json / oxfmtrc.json)
53+
// stays identical on both sides; only the directory differs.
54+
function pickConfig(basename: string): string {
55+
const repoOverlay = path.join('.config', 'repo', basename)
56+
if (existsSync(repoOverlay)) {
57+
return repoOverlay
58+
}
59+
return path.join('.config', 'fleet', basename)
60+
}
61+
4662
// Paths that, when touched, force a full-workspace lint.
4763
const ESCALATION_PATTERNS = [
4864
/^\.config\//,
@@ -168,7 +184,7 @@ function runAll(): number {
168184
'exec',
169185
'oxfmt',
170186
'-c',
171-
'.config/fleet/oxfmtrc.json',
187+
pickConfig('oxfmtrc.json'),
172188
'--ignore-path',
173189
'.config/fleet/.prettierignore',
174190
fix ? '--write' : '--check',
@@ -179,7 +195,7 @@ function runAll(): number {
179195
return 1
180196
}
181197
log('Running oxlint on all files…')
182-
const oxlintArgs = ['exec', 'oxlint', '-c', '.config/fleet/oxlintrc.json']
198+
const oxlintArgs = ['exec', 'oxlint', '-c', pickConfig('oxlintrc.json')]
183199
if (fix) {
184200
oxlintArgs.push('--fix')
185201
}
@@ -247,7 +263,7 @@ function runFiles(files: string[]): number {
247263
'exec',
248264
'oxfmt',
249265
'-c',
250-
'.config/fleet/oxfmtrc.json',
266+
pickConfig('oxfmtrc.json'),
251267
'--ignore-path',
252268
'.config/fleet/.prettierignore',
253269
fix ? '--write' : '--check',
@@ -268,7 +284,7 @@ function runFiles(files: string[]): number {
268284
'exec',
269285
'oxlint',
270286
'-c',
271-
'.config/fleet/oxlintrc.json',
287+
pickConfig('oxlintrc.json'),
272288
'--no-error-on-unmatched-pattern',
273289
]
274290
if (fix) {

0 commit comments

Comments
 (0)