load-oxfmt-config 0.6.0 → 0.7.1

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/README.md CHANGED
@@ -191,7 +191,7 @@ Load and parse oxfmt configuration files, then merge supported `.editorconfig` f
191
191
 
192
192
  **Parameters:**
193
193
 
194
- - `options` - Optional configuration object (`Options`)
194
+ - `options` - Optional configuration object (`LoadOxfmtConfigOptions`)
195
195
 
196
196
  Option fields:
197
197
 
@@ -250,7 +250,7 @@ Load and parse oxfmt configuration files, merge supported `.editorconfig` fields
250
250
 
251
251
  **Parameters:**
252
252
 
253
- - `options` - Optional configuration object (`Options`)
253
+ - `options` - Optional configuration object (`LoadOxfmtConfigOptions`)
254
254
 
255
255
  Option fields:
256
256
 
@@ -364,7 +364,7 @@ Can be passed multiple times in CLI style.
364
364
  #### `withNodeModules`
365
365
 
366
366
  - **Type:** `boolean`
367
- - **Default:** `true`
367
+ - **Default:** `false`
368
368
 
369
369
  Whether `node_modules` should be included.
370
370
 
@@ -389,6 +389,14 @@ Whether to use in-memory cache.
389
389
 
390
390
  Whether to include ignore patterns defined in the resolved config file.
391
391
 
392
+ #### `loadConfigForIgnorePatterns`
393
+
394
+ - **Type:** `boolean`
395
+ - **Default:** `true`
396
+
397
+ Whether to load the resolved config file during ignore checks.
398
+ When `false`, `isOxfmtIgnored()` only applies global ignore and skips config loading.
399
+
392
400
  **Returns:** `Promise<IsOxfmtIgnoredResult>`
393
401
 
394
402
  - `ignored` - Whether the file is ignored
@@ -478,7 +486,8 @@ Only `[*]` is treated as a global section to match oxfmt. Other sections such as
478
486
  1. Global ignore
479
487
  2. Ignore patterns from the resolved oxfmt config (`ignorePatterns`)
480
488
 
481
- Set `includeConfigIgnorePatterns: false` to keep only global ignore behavior (skip config `ignorePatterns`).
489
+ Set `includeConfigIgnorePatterns: false` to skip config `ignorePatterns` matching.
490
+ Set `loadConfigForIgnorePatterns: false` to skip config loading entirely and keep only global ignore behavior.
482
491
 
483
492
  Global ignore includes:
484
493
 
@@ -491,10 +500,15 @@ Global ignore includes:
491
500
  Notes:
492
501
 
493
502
  - `node_modules` can be included by passing `withNodeModules: true`.
503
+
504
+ Type compatibility note:
505
+
506
+ - `Options` is still exported as a deprecated alias of `LoadOxfmtConfigOptions`.
494
507
  - This package does not read parent `.gitignore` files or global gitignore settings.
495
508
  - The default lockfile list mirrors oxfmt documentation intent (`package-lock.json`, `pnpm-lock.yaml`, etc.) and common ecosystem lockfiles. It is not guaranteed to be a complete internal oxfmt list.
496
509
  - `ignorePatterns` are always interpreted relative to the resolved oxfmt config directory.
497
510
  - `includeConfigIgnorePatterns` defaults to `true` to preserve current behavior.
511
+ - `loadConfigForIgnorePatterns` defaults to `true` to preserve current behavior.
498
512
  - Nested config behavior follows oxfmt semantics:
499
513
  - default: nearest config from target file directory upward
500
514
  - `disableNestedConfig: true`: resolve from `cwd` only
package/dist/index.d.mts CHANGED
@@ -39,7 +39,7 @@ interface OxfmtConfigOverride {
39
39
  */
40
40
  options?: FormatConfig;
41
41
  }
42
- interface Options {
42
+ interface LoadOxfmtConfigOptions {
43
43
  /**
44
44
  * Path to the configuration file
45
45
  */
@@ -119,7 +119,7 @@ interface IsOxfmtIgnoredOptions {
119
119
  ignorePath?: string | string[];
120
120
  /**
121
121
  * Whether node_modules should be included.
122
- * @default true
122
+ * @default false
123
123
  */
124
124
  withNodeModules?: boolean;
125
125
  /**
@@ -137,6 +137,12 @@ interface IsOxfmtIgnoredOptions {
137
137
  * @default true
138
138
  */
139
139
  includeConfigIgnorePatterns?: boolean;
140
+ /**
141
+ * Whether to load resolved oxfmt config when evaluating config ignore patterns.
142
+ * When false, only global ignore is applied and config loading is skipped.
143
+ * @default true
144
+ */
145
+ loadConfigForIgnorePatterns?: boolean;
140
146
  }
141
147
  /**
142
148
  * Ignore resolution result.
@@ -155,6 +161,10 @@ interface IsOxfmtIgnoredResult {
155
161
  * @deprecated Use `OxfmtConfigOverride` instead
156
162
  */
157
163
  type FormatOptionOverride = OxfmtConfigOverride;
164
+ /**
165
+ * @deprecated Use `LoadOxfmtConfigOptions` instead.
166
+ */
167
+ type Options = LoadOxfmtConfigOptions;
158
168
  //#endregion
159
169
  //#region src/config-file.d.ts
160
170
  /**
@@ -192,7 +202,7 @@ declare function resolveOxfmtrcPath(cwd: string, configPath?: string): Promise<s
192
202
  * console.log(result.config)
193
203
  * ```
194
204
  */
195
- declare function loadOxfmtConfigResult(options?: Options): Promise<LoadOxfmtConfigResult>;
205
+ declare function loadOxfmtConfigResult(options?: LoadOxfmtConfigOptions): Promise<LoadOxfmtConfigResult>;
196
206
  //#endregion
197
207
  //#region src/ignore.d.ts
198
208
  /**
@@ -232,6 +242,6 @@ declare function isOxfmtIgnored(options: IsOxfmtIgnoredOptions): Promise<IsOxfmt
232
242
  * const config = await loadOxfmtConfig({ cwd: process.cwd() })
233
243
  * ```
234
244
  */
235
- declare function loadOxfmtConfig(options?: Options): Promise<OxfmtOptions>;
245
+ declare function loadOxfmtConfig(options?: LoadOxfmtConfigOptions): Promise<OxfmtOptions>;
236
246
  //#endregion
237
- export { EditorconfigOption, FormatOptionOverride, IsOxfmtIgnoredOptions, IsOxfmtIgnoredResult, LoadOxfmtConfigResult, Options, OxfmtConfigOverride, OxfmtOptions, isOxfmtIgnored, loadOxfmtConfig, loadOxfmtConfigResult, resolveOxfmtrcPath };
247
+ export { EditorconfigOption, FormatOptionOverride, IsOxfmtIgnoredOptions, IsOxfmtIgnoredResult, LoadOxfmtConfigOptions, LoadOxfmtConfigResult, Options, OxfmtConfigOverride, OxfmtOptions, isOxfmtIgnored, loadOxfmtConfig, loadOxfmtConfigResult, resolveOxfmtrcPath };
package/dist/index.mjs CHANGED
@@ -555,6 +555,7 @@ function matchConfigIgnorePatterns(filepath, configDir, patterns) {
555
555
  async function isOxfmtIgnored(options) {
556
556
  const useCache = options.useCache !== false;
557
557
  const includeConfigIgnorePatterns = options.includeConfigIgnorePatterns !== false;
558
+ const loadConfigForIgnorePatterns = options.loadConfigForIgnorePatterns !== false;
558
559
  const cwd = resolve(options.cwd ?? process.cwd());
559
560
  const filepath = isAbsolute(options.filepath) ? resolve(options.filepath) : resolve(cwd, options.filepath);
560
561
  if (isDefaultIgnoredDir(filepath, options.withNodeModules ? { withNodeModules: true } : {})) return {
@@ -575,6 +576,7 @@ async function isOxfmtIgnored(options) {
575
576
  ignored: true,
576
577
  reason: ignoreFile === ".gitignore" ? "gitignore" : "prettierignore"
577
578
  };
579
+ if (!loadConfigForIgnorePatterns) return { ignored: false };
578
580
  const configResult = await loadOxfmtConfigResult({
579
581
  cwd: options.configPath || options.disableNestedConfig ? cwd : dirname(filepath),
580
582
  ...options.configPath ? { configPath: options.configPath } : {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "load-oxfmt-config",
3
- "version": "0.6.0",
3
+ "version": "0.7.1",
4
4
  "description": "Load oxfmt config files and merge supported .editorconfig options.",
5
5
  "keywords": [
6
6
  "editorconfig",
@@ -48,16 +48,16 @@
48
48
  },
49
49
  "devDependencies": {
50
50
  "@ntnyq/tsconfig": "^3.1.0",
51
- "@types/node": "^25.6.0",
51
+ "@types/node": "^25.6.2",
52
52
  "@types/picomatch": "^4.0.3",
53
- "@typescript/native-preview": "^7.0.0-dev.20260506.1",
54
- "bumpp": "^11.0.1",
53
+ "@typescript/native-preview": "^7.0.0-dev.20260507.1",
54
+ "bumpp": "^11.1.0",
55
55
  "husky": "^9.1.7",
56
56
  "nano-staged": "^1.0.2",
57
57
  "npm-run-all2": "^8.0.4",
58
58
  "oxfmt": "^0.48.0",
59
59
  "oxlint": "^1.63.0",
60
- "tsdown": "^0.21.10",
60
+ "tsdown": "^0.22.0",
61
61
  "vitest": "^4.1.5"
62
62
  },
63
63
  "peerDependencies": {