eslint-plugin-oxfmt 0.0.9 → 0.0.10

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
@@ -14,7 +14,7 @@
14
14
  - 🎯 **ESLint Integration** - Seamlessly integrates with ESLint v9+ flat config
15
15
  - 📦 **Zero Config** - Works out of the box with sensible defaults
16
16
  - 🎨 **Highly Configurable** - Support for all oxfmt formatting options
17
- - 🌐 **Multi-language Support** - JavaScript, TypeScript, JSX, TSX and more
17
+ - 🌐 **Multi-language Support** - JavaScript, TypeScript, JSX, TSX and [more](https://oxc.rs/docs/guide/usage/formatter.html#supported-languages)
18
18
 
19
19
  ## Requirements
20
20
 
@@ -23,15 +23,15 @@
23
23
 
24
24
  ## Installation
25
25
 
26
- ```bash
26
+ ```shell
27
27
  npm install -D oxfmt eslint-plugin-oxfmt
28
28
  ```
29
29
 
30
- ```bash
30
+ ```shell
31
31
  yarn add -D oxfmt eslint-plugin-oxfmt
32
32
  ```
33
33
 
34
- ```bash
34
+ ```shell
35
35
  pnpm add -D oxfmt eslint-plugin-oxfmt
36
36
  ```
37
37
 
@@ -69,6 +69,10 @@ export default [
69
69
  'oxfmt/oxfmt': [
70
70
  'error',
71
71
  {
72
+ // Plugin options
73
+ useConfig: false,
74
+ configPath: 'configs/.oxfmtrc.json',
75
+
72
76
  // Formatting options
73
77
  semi: false,
74
78
  singleQuote: true,
@@ -126,6 +130,15 @@ export default [
126
130
 
127
131
  All options are optional and default to sensible values.
128
132
 
133
+ ### Plugin Options
134
+
135
+ | Option | Type | Default | Description |
136
+ | ------------ | --------- | ------- | ------------------------------------------------------------------------------------------------------ |
137
+ | `useConfig` | `boolean` | `true` | Load `.oxfmtrc` / config files via `load-oxfmt-config`. Set to `false` to rely only on inline options. |
138
+ | `configPath` | `string` | — | Custom path to an oxfmt config file. Resolved from ESLint `cwd` when set. |
139
+
140
+ > Note: `cwd` is taken from ESLint automatically; you usually do not need to set it manually.
141
+
129
142
  ### Basic Options
130
143
 
131
144
  | Option | Type | Default | Description |
@@ -239,16 +252,16 @@ export default [
239
252
 
240
253
  You can pass the Tailwind plugin options to control which attributes/functions are sorted or keep duplicates:
241
254
 
242
- ```js
255
+ ```json
243
256
  {
244
- experimentalTailwindcss: {
245
- attributes: ['class', 'className', ':class'],
246
- config: './tailwind.config.js',
247
- functions: ['clsx', 'cn'],
248
- preserveDuplicates: false,
249
- preserveWhitespace: false,
250
- stylesheet: './src/app.css',
251
- },
257
+ "experimentalTailwindcss": {
258
+ "attributes": ["class", "className", ":class"],
259
+ "config": "./tailwind.config.js",
260
+ "functions": ["clsx", "cn"],
261
+ "preserveDuplicates": false,
262
+ "preserveWhitespace": false,
263
+ "stylesheet": "./src/app.css"
264
+ }
252
265
  }
253
266
  ```
254
267
 
@@ -304,7 +317,7 @@ This plugin provides a single rule that formats your code using oxfmt.
304
317
  - Fixable: Yes (automatically applies formatting)
305
318
  - Type: Layout
306
319
 
307
- ## Examples
320
+ ## Integration
308
321
 
309
322
  ### Format on Save in VS Code
310
323
 
@@ -324,15 +337,9 @@ Add this to your `.vscode/settings.json`:
324
337
  }
325
338
  ```
326
339
 
327
- ### Run from Command Line
340
+ ## Suppported languages
328
341
 
329
- ```bash
330
- # Check for formatting issues
331
- npx eslint .
332
-
333
- # Fix formatting issues
334
- npx eslint . --fix
335
- ```
342
+ - Check [Oxfmt - Supported languages](https://oxc.rs/docs/guide/usage/formatter.html#supported-languages)
336
343
 
337
344
  ## Why oxfmt?
338
345
 
package/dist/index.mjs CHANGED
@@ -67,7 +67,7 @@ const configs = { recommended };
67
67
  //#endregion
68
68
  //#region package.json
69
69
  var name = "eslint-plugin-oxfmt";
70
- var version = "0.0.9";
70
+ var version = "0.0.10";
71
71
 
72
72
  //#endregion
73
73
  //#region src/meta.ts
@@ -399,6 +399,10 @@ const oxfmt = {
399
399
  type: "object",
400
400
  properties: {
401
401
  ...sharedSchema.properties,
402
+ configPath: {
403
+ description: `Path to Oxfmt configuration file.\nIf you provide an absolute path, Oxfmt will use it directly.\n If not provided, Oxfmt will search for configuration files starting from the current working directory upwards.\n\n- (Default: undefined)`,
404
+ type: "string"
405
+ },
402
406
  overrides: {
403
407
  description: `File-specific overrides.\nWhen a file matches multiple overrides, the later override takes precedence (array order matters).\n\n- (Default: [])`,
404
408
  type: "array",
@@ -425,6 +429,10 @@ const oxfmt = {
425
429
  }
426
430
  }
427
431
  }
432
+ },
433
+ useConfig: {
434
+ description: `Whether to load Oxfmt configuration file.\n\n- (Default: true)`,
435
+ type: "boolean"
428
436
  }
429
437
  }
430
438
  }]
@@ -100,6 +100,8 @@ export type OxfmtOxfmt = []|[{
100
100
 
101
101
  vueIndentScriptAndStyle?: boolean
102
102
 
103
+ configPath?: string
104
+
103
105
  overrides?: {
104
106
 
105
107
  excludeFiles?: string[]
@@ -195,4 +197,6 @@ export type OxfmtOxfmt = []|[{
195
197
  vueIndentScriptAndStyle?: boolean
196
198
  }
197
199
  }[]
200
+
201
+ useConfig?: boolean
198
202
  }]
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-oxfmt",
3
3
  "type": "module",
4
- "version": "0.0.9",
4
+ "version": "0.0.10",
5
5
  "description": "An ESLint plugin for formatting code with oxfmt.",
6
6
  "keywords": [
7
7
  "eslint",
@@ -52,11 +52,10 @@
52
52
  "synckit": "^0.11.12"
53
53
  },
54
54
  "devDependencies": {
55
- "@ntnyq/eslint-config": "^5.9.0",
56
- "@ntnyq/prettier-config": "^3.0.1",
55
+ "@ntnyq/eslint-config": "^6.0.0-beta.2",
57
56
  "@types/json-schema": "^7.0.15",
58
- "@types/node": "^25.0.9",
59
- "@typescript/native-preview": "^7.0.0-dev.20260119.1",
57
+ "@types/node": "^25.0.10",
58
+ "@typescript/native-preview": "^7.0.0-dev.20260120.1",
60
59
  "bumpp": "^10.4.0",
61
60
  "eslint": "^9.39.2",
62
61
  "eslint-parser-plain": "^0.1.1",
@@ -66,24 +65,25 @@
66
65
  "nano-staged": "^0.9.0",
67
66
  "npm-run-all2": "^8.0.4",
68
67
  "oxfmt": "^0.26.0",
69
- "prettier": "^3.8.0",
70
68
  "show-invisibles": "^0.0.2",
71
69
  "tinyglobby": "^0.2.15",
72
- "tsdown": "^0.20.0-beta.3",
70
+ "tsdown": "^0.20.0-beta.4",
73
71
  "tsx": "^4.21.0",
74
72
  "typescript": "^5.9.3",
75
- "vitest": "^4.0.17"
73
+ "vitest": "^4.0.17",
74
+ "eslint-plugin-oxfmt": "0.0.10"
76
75
  },
77
76
  "engines": {
78
77
  "node": "^20.19.0 || >=22.12.0"
79
78
  },
80
79
  "nano-staged": {
81
- "*.{js,ts,mjs,cjs,md,vue,yml,yaml,toml,json}": "eslint --fix",
82
- "*.{css,scss,html}": "prettier -uw"
80
+ "*.{js,ts,mjs,cjs,md,vue,yml,yaml,toml,json}": "eslint --fix"
83
81
  },
84
82
  "scripts": {
85
83
  "build": "pnpm run update:rule-options && tsdown",
86
84
  "dev": "tsdown --watch",
85
+ "format": "oxfmt",
86
+ "format:check": "oxfmt --check",
87
87
  "lint": "eslint",
88
88
  "release": "run-s release:check release:version",
89
89
  "release:check": "run-s lint typecheck test build",