You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Keep changes aligned with flat-config usage and exported presets in [src/configs.ts](src/configs.ts).
29
+
- Do not hand-edit generated types in [dts/rule-options.d.ts](dts/rule-options.d.ts); regenerate via `pnpm update:rule-options`.
30
+
- If schema or option enums change, update [src/schema.ts](src/schema.ts) and run `pnpm check:schema` (script: [scripts/checkSchemaParity.ts](scripts/checkSchemaParity.ts)).
31
+
- Preserve virtual-file skip behavior in rule execution (processor-extracted files) covered by [tests/rules/error-reporting.test.ts](tests/rules/error-reporting.test.ts).
32
+
- Keep config-loading semantics test-aligned, especially when `useConfig` is true (rule-level overrides are still merged), covered by [tests/eslint-plugin.test.ts](tests/eslint-plugin.test.ts).
33
+
34
+
## Architecture Map
35
+
36
+
- Plugin entry and exports: [src/index.ts](src/index.ts)
- Prefer targeted test runs first, then full suite before finalizing.
46
+
- For preset or config behavior changes: run [tests/configs.test.ts](tests/configs.test.ts), [tests/cli-parity.test.ts](tests/cli-parity.test.ts), and [tests/eslint-plugin.test.ts](tests/eslint-plugin.test.ts).
47
+
- For formatter/rule behavior changes: run [tests/rules/oxfmt.test.ts](tests/rules/oxfmt.test.ts) and [tests/rules/error-reporting.test.ts](tests/rules/error-reporting.test.ts).
48
+
- For schema-related changes: run [tests/schema-parity.test.ts](tests/schema-parity.test.ts) and `pnpm check:schema`.
49
+
50
+
## Link-First Docs
51
+
52
+
- User-facing usage and options: [README.md](README.md)
53
+
- Build and release scripts: [package.json](package.json)
54
+
- Type generation implementation: [scripts/updateRuleOptions.ts](scripts/updateRuleOptions.ts)
|`useConfig`|`boolean`|`true`| Load `.oxfmtrc.json`, `.oxfmtrc.jsonc`, or `oxfmt.config.ts` via `load-oxfmt-config` (with `.editorconfig` merge support). Set to `false` to rely only on inline options. |
163
-
|`configPath`|`string`| — | Custom path to an oxfmt config file. Resolved from ESLint `cwd` when set. |
|`useConfig`|`boolean`|`true`| Load `.oxfmtrc.json`, `.oxfmtrc.jsonc`, or `oxfmt.config.*` via `load-oxfmt-config`. Set to `false` to rely only on inline options. |
177
+
|`configPath`|`string`| — | Custom path to an oxfmt config file. Resolved from ESLint `cwd` when set. |
178
+
|`ignorePath`|`string \| string[]`| — | Ignore file path(s) for CLI-style ignore resolution (same role as CLI `--ignore-path`). |
179
+
|`withNodeModules`|`boolean`|`false`| Include files under `node_modules` during ignore checks. |
180
+
|`disableNestedConfig`|`boolean`|`false`| Disable nested config discovery and resolve config from `cwd` / `configPath` only. |
@@ -173,8 +191,9 @@ When `useConfig` is `true`, the plugin loads config using `load-oxfmt-config`.
173
191
-`.editorconfig` support: nearest `.editorconfig` (including section overrides) is merged into the final options
174
192
-`configPath` overrides discovery and directly targets the specified config file
175
193
- ESLint rule options generally take highest priority because inline rule options are merged after loaded config.
176
-
- When `useConfig` is `true`, rule-level `overrides` are ignored. Only `overrides` loaded from the resolved oxfmt config file are applied.
177
-
- Rule-level `ignorePatterns` still override config-derived `ignorePatterns` when provided.
194
+
- Rule-level `ignorePatterns` are resolved relative to ESLint `cwd`; config-level `ignorePatterns` are resolved relative to the resolved config file directory.
195
+
- When `useConfig` is `true`, config `overrides` are applied first and rule-level `overrides` are appended after them (later entries win on conflicts).
196
+
- When `useConfig` is `false`, config discovery and config `ignorePatterns` are skipped, while global ignores still apply when `respectOxfmtDefaultIgnores` is enabled.
178
197
179
198
For detailed behavior, see:
180
199
@@ -381,12 +400,31 @@ This plugin provides a single rule that formats your code using oxfmt.
381
400
- Fixable: Yes (automatically applies formatting)
382
401
- Type: Layout
383
402
403
+
## CLI parity mode
404
+
405
+
`oxfmt/cli-parity` tries to match `oxfmt` CLI behavior for files processed by ESLint.
406
+
407
+
It respects:
408
+
409
+
-`.oxfmtrc.json`
410
+
-`.oxfmtrc.jsonc`
411
+
-`oxfmt.config.*`
412
+
-`.editorconfig`
413
+
-`ignorePatterns`
414
+
-`.gitignore`
415
+
-`.prettierignore`
416
+
- default ignored directories
417
+
- default ignored lockfiles
418
+
419
+
Note: ESLint still controls file discovery. Files excluded by ESLint will never reach this rule.
420
+
384
421
## Integration
385
422
386
423
### Parser Compatibility
387
424
388
425
-`recommended`: forces `eslint-parser-plain` for matched files
389
426
-`recommendedWithoutParser`: parser-agnostic (safe to compose with language-specific parsers)
427
+
-`cliParity`: parser-agnostic preset tuned for CLI-like config/ignore behavior
390
428
391
429
When composing shareable configs, prefer `recommendedWithoutParser` if parser ownership belongs to another preset.
0 commit comments