eslint-plugin-oxfmt 0.7.0 → 0.8.0
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 +2 -2
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -1
- package/package.json +10 -10
- package/workers/oxfmt.mjs +3 -7
package/README.md
CHANGED
|
@@ -190,8 +190,8 @@ All options are optional and default to sensible values.
|
|
|
190
190
|
|
|
191
191
|
When `useConfig` is `true`, the plugin loads config using `load-oxfmt-config`.
|
|
192
192
|
|
|
193
|
-
- Config discovery order (from
|
|
194
|
-
- `.editorconfig` support: nearest `.editorconfig` (
|
|
193
|
+
- Config discovery order (from the formatted file's directory, walking upward): `.oxfmtrc.json` → `.oxfmtrc.jsonc` → `oxfmt.config.ts` / `oxfmt.config.mts` / `oxfmt.config.cts` / `oxfmt.config.js` / `oxfmt.config.mjs` / `oxfmt.config.cjs`
|
|
194
|
+
- `.editorconfig` support follows oxfmt behavior: only the nearest `.editorconfig` is loaded for the current file (with section overrides in that file)
|
|
195
195
|
- Set `editorconfig: false` to disable `.editorconfig` merging
|
|
196
196
|
- Set `editorconfig: { onlyCwd: true }` to read only the current `cwd`'s `.editorconfig` (no upward traversal)
|
|
197
197
|
- Set `editorconfig: { cwd: '/path/to/base' }` to customize editorconfig resolution base directory
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$eslint from "eslint";
|
|
2
1
|
import { Linter, Rule } from "eslint";
|
|
3
2
|
//#region src/types.d.ts
|
|
4
3
|
interface PluginOxfmt {
|
|
@@ -24,7 +23,7 @@ declare const meta: {
|
|
|
24
23
|
//#endregion
|
|
25
24
|
//#region src/rules/index.d.ts
|
|
26
25
|
declare const rules: {
|
|
27
|
-
oxfmt:
|
|
26
|
+
oxfmt: import("eslint").Rule.RuleModule;
|
|
28
27
|
};
|
|
29
28
|
//#endregion
|
|
30
29
|
//#region src/parser.d.ts
|
package/dist/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-oxfmt",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.8.0",
|
|
5
5
|
"description": "An ESLint plugin for formatting code with oxfmt.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"sideEffects": false,
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"eslint": "^9.5.0 || ^10.0.0",
|
|
47
|
-
"oxfmt": ">=0.
|
|
47
|
+
"oxfmt": ">=0.50.0",
|
|
48
48
|
"svelte": "*"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
@@ -54,17 +54,17 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"generate-differences": "^0.1.1",
|
|
57
|
-
"load-oxfmt-config": "^0.
|
|
57
|
+
"load-oxfmt-config": "^0.9.0",
|
|
58
58
|
"picomatch": "^4.0.4",
|
|
59
59
|
"synckit": "^0.11.12"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@ntnyq/eslint-config": "^6.1.3",
|
|
63
63
|
"@types/json-schema": "^7.0.15",
|
|
64
|
-
"@types/node": "^25.
|
|
65
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
64
|
+
"@types/node": "^25.8.0",
|
|
65
|
+
"@typescript/native-preview": "^7.0.0-dev.20260517.1",
|
|
66
66
|
"bumpp": "^11.1.0",
|
|
67
|
-
"eslint": "^10.
|
|
67
|
+
"eslint": "^10.4.0",
|
|
68
68
|
"eslint-parser-plain": "^0.1.1",
|
|
69
69
|
"eslint-typegen": "^2.3.1",
|
|
70
70
|
"eslint-vitest-rule-tester": "^3.1.0",
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
"jsonc-eslint-parser": "^3.1.0",
|
|
73
73
|
"nano-staged": "^1.0.2",
|
|
74
74
|
"npm-run-all2": "^8.0.4",
|
|
75
|
-
"oxfmt": "^0.
|
|
75
|
+
"oxfmt": "^0.50.0",
|
|
76
76
|
"show-invisibles": "^0.0.2",
|
|
77
|
-
"svelte": "^5.55.
|
|
77
|
+
"svelte": "^5.55.7",
|
|
78
78
|
"tinyglobby": "^0.2.16",
|
|
79
79
|
"tsdown": "^0.22.0",
|
|
80
|
-
"tsx": "^4.
|
|
80
|
+
"tsx": "^4.22.1",
|
|
81
81
|
"typescript": "^6.0.3",
|
|
82
82
|
"vitest": "^4.1.6",
|
|
83
|
-
"eslint-plugin-oxfmt": "0.
|
|
83
|
+
"eslint-plugin-oxfmt": "0.8.0"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
86
|
"node": "^20.19.0 || >=22.12.0"
|
package/workers/oxfmt.mjs
CHANGED
|
@@ -172,16 +172,12 @@ async function formatViaOxfmt(filename, sourceText, options = {}) {
|
|
|
172
172
|
let finalOptions
|
|
173
173
|
|
|
174
174
|
if (useConfig) {
|
|
175
|
-
const configResolutionCwd = pluginOptions.configPath
|
|
176
|
-
? cwd
|
|
177
|
-
: pluginOptions.disableNestedConfig
|
|
178
|
-
? cwd
|
|
179
|
-
: dirname(filename)
|
|
180
|
-
|
|
181
175
|
const loaded = await loadOxfmtConfig({
|
|
182
176
|
configPath: pluginOptions.configPath,
|
|
183
|
-
cwd:
|
|
177
|
+
cwd: cwd ?? dirname(filename),
|
|
178
|
+
disableNestedConfig: pluginOptions.disableNestedConfig,
|
|
184
179
|
editorconfig: pluginOptions.editorconfig,
|
|
180
|
+
filepath: filename,
|
|
185
181
|
useCache: pluginOptions.useCache,
|
|
186
182
|
})
|
|
187
183
|
const { overrides: configOverrides, ...loadedConfig } = loaded.config
|