Skip to content

Commit 2f70a98

Browse files
committed
fix(scripts/lint): pass --no-error-on-unmatched-pattern to oxfmt
When pre-commit lints only files that fall under oxfmt's ignorePatterns (e.g. .claude/** when only a hook is staged), oxfmt receives a non-empty file list but its own ignore filter knocks them all out, then exits with "Expected at least one target file" — blocking the commit. The flag tells oxfmt to exit 0 with "No files found matching the given patterns" instead. Matches socket-repo-template/template/scripts/lint.mts behavior.
1 parent 11737cc commit 2f70a98

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

scripts/lint.mts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,17 @@ async function runLintOnFiles(
167167
// Build the linter configurations.
168168
const linters = [
169169
{
170-
args: ['exec', 'oxfmt', ...(fix ? [] : ['--check']), ...files],
170+
// --no-error-on-unmatched-pattern: don't error when every staged
171+
// file lands in oxfmt's ignorePatterns (e.g. only `.claude/**`
172+
// files staged). Tool exits 0 with "No files found" instead of
173+
// throwing.
174+
args: [
175+
'exec',
176+
'oxfmt',
177+
'--no-error-on-unmatched-pattern',
178+
...(fix ? [] : ['--check']),
179+
...files,
180+
],
171181
name: 'oxfmt',
172182
enabled: true,
173183
},

0 commit comments

Comments
 (0)