Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,10 @@
"trailingCommas": "all",
"semicolons": "always"
}
},
"json": {
"parser": {
"allowComments": true
}
}
}
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"p-map": "^7.0.3",
"picocolors": "^1.1.1",
"strip-comments": "^2.0.1",
"strip-json-comments": "^5.0.1",
"tiktoken": "^1.0.18",
"zod": "^3.24.1"
},
Expand Down
1 change: 1 addition & 0 deletions repomix.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
"ignore": {
"useGitignore": true,
"useDefaultPatterns": true,
// ignore is specified in .repomixignore
"customPatterns": []
},
"security": {
Expand Down
3 changes: 2 additions & 1 deletion src/config/configLoad.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as fs from 'node:fs/promises';
import path from 'node:path';
import stripJsonComments from 'strip-json-comments';
import { z } from 'zod';
import { RepomixError, rethrowValidationErrorIfZodError } from '../shared/errorHandle.js';
import { logger } from '../shared/logger.js';
Expand Down Expand Up @@ -67,7 +68,7 @@ export const loadFileConfig = async (rootDir: string, argConfigPath: string | nu
const loadAndValidateConfig = async (filePath: string): Promise<RepomixConfigFile> => {
try {
const fileContent = await fs.readFile(filePath, 'utf-8');
const config = JSON.parse(fileContent);
const config = JSON.parse(stripJsonComments(fileContent));
Comment thread
yamadashy marked this conversation as resolved.
return repomixConfigFileSchema.parse(config);
} catch (error) {
rethrowValidationErrorIfZodError(error, 'Invalid config schema');
Expand Down