load-oxfmt-config 0.7.1 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +5 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -136,13 +136,16 @@ async function readConfigFromFile(resolvedPath) {
|
|
|
136
136
|
const content = await readFile(resolvedPath, "utf8");
|
|
137
137
|
if (extension === ".jsonc") {
|
|
138
138
|
const parseErrors = [];
|
|
139
|
-
const parsed = parse(content, parseErrors
|
|
139
|
+
const parsed = parse(content, parseErrors, {
|
|
140
|
+
allowTrailingComma: true,
|
|
141
|
+
allowEmptyContent: true
|
|
142
|
+
});
|
|
140
143
|
if (parseErrors.length > 0) {
|
|
141
144
|
const firstError = parseErrors[0];
|
|
142
145
|
const errorCode = firstError === void 0 ? "Unknown" : printParseErrorCode(firstError.error);
|
|
143
146
|
throw new Error(`Invalid JSONC syntax: ${errorCode}`);
|
|
144
147
|
}
|
|
145
|
-
return parsed;
|
|
148
|
+
return parsed ?? {};
|
|
146
149
|
}
|
|
147
150
|
if (extension === ".json") return JSON.parse(content);
|
|
148
151
|
if (!extension) return JSON.parse(content);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "load-oxfmt-config",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "Load oxfmt config files and merge supported .editorconfig options.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"editorconfig",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@ntnyq/tsconfig": "^3.1.0",
|
|
51
51
|
"@types/node": "^25.6.2",
|
|
52
52
|
"@types/picomatch": "^4.0.3",
|
|
53
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
53
|
+
"@typescript/native-preview": "^7.0.0-dev.20260508.1",
|
|
54
54
|
"bumpp": "^11.1.0",
|
|
55
55
|
"husky": "^9.1.7",
|
|
56
56
|
"nano-staged": "^1.0.2",
|