eslint-plugin-oxfmt 0.0.13 → 0.0.14

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 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.13";
70
+ var version = "0.0.14";
71
71
 
72
72
  //#endregion
73
73
  //#region src/meta.ts
@@ -170,7 +170,7 @@ const oxfmtOptionsSchema = {
170
170
  type: "boolean"
171
171
  },
172
172
  embeddedLanguageFormatting: {
173
- description: `Control whether to format embedded parts in the file.\ne.g. JS-in-Vue, CSS-in-JS, etc. (Default: "auto")`,
173
+ description: `Control whether to format embedded parts (For example, CSS-in-JS, or JS-in-Vue, etc.) in the file.\n\nNOTE: XXX-in-JS support is incomplete.\n\n- (Default: "auto")`,
174
174
  enum: ["auto", "off"],
175
175
  type: "string"
176
176
  },
@@ -196,7 +196,7 @@ const oxfmtOptionsSchema = {
196
196
  type: "object",
197
197
  properties: {
198
198
  elementNamePattern: {
199
- description: `List of import name prefixes to match for this group.`,
199
+ description: `List of glob patterns to match import sources for this group.`,
200
200
  type: "array",
201
201
  items: { type: "string" }
202
202
  },
@@ -264,7 +264,7 @@ const oxfmtOptionsSchema = {
264
264
  type: "object",
265
265
  properties: {
266
266
  attributes: {
267
- description: `List of attributes that contain Tailwind CSS classes.\n\n- (Example: ["myClassProp", ":class"])\n\n- (Default: ["class", "className"])`,
267
+ description: `List of additional attributes to sort beyond "class" and "className" (exact match).\n\nNOTE: Regex patterns are not yet supported.\n\n- (Default: [])\n- Example: ["myClassProp", ":class"]`,
268
268
  type: "array",
269
269
  items: { type: "string" }
270
270
  },
@@ -273,7 +273,7 @@ const oxfmtOptionsSchema = {
273
273
  type: "string"
274
274
  },
275
275
  functions: {
276
- description: `List of custom function names that contain Tailwind CSS classes.\n\nExample: ["clsx", "cn", "cva", "tw"]\n\n- (Default: [])`,
276
+ description: `List of custom function names whose arguments should be sorted (exact match).\n\nNOTE: Regex patterns are not yet supported.\n\n- (Default: [])\n- Example: ["clsx", "cn", "cva", "tw"]`,
277
277
  type: "array",
278
278
  items: { type: "string" }
279
279
  },
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eslint-plugin-oxfmt",
3
3
  "type": "module",
4
- "version": "0.0.13",
4
+ "version": "0.0.14",
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",
47
- "oxfmt": "^0.28.0"
47
+ "oxfmt": "^0.31.0"
48
48
  },
49
49
  "dependencies": {
50
50
  "generate-differences": "^0.1.1",
@@ -53,10 +53,10 @@
53
53
  "synckit": "^0.11.12"
54
54
  },
55
55
  "devDependencies": {
56
- "@ntnyq/eslint-config": "^6.0.0-beta.7",
56
+ "@ntnyq/eslint-config": "^6.0.0-beta.8",
57
57
  "@types/json-schema": "^7.0.15",
58
- "@types/node": "^25.2.2",
59
- "@typescript/native-preview": "^7.0.0-dev.20260208.1",
58
+ "@types/node": "^25.2.3",
59
+ "@typescript/native-preview": "^7.0.0-dev.20260210.1",
60
60
  "bumpp": "^10.4.1",
61
61
  "eslint": "^9.39.2",
62
62
  "eslint-parser-plain": "^0.1.1",
@@ -65,20 +65,20 @@
65
65
  "husky": "^9.1.7",
66
66
  "nano-staged": "^0.9.0",
67
67
  "npm-run-all2": "^8.0.4",
68
- "oxfmt": "^0.28.0",
68
+ "oxfmt": "^0.31.0",
69
69
  "show-invisibles": "^0.0.2",
70
70
  "tinyglobby": "^0.2.15",
71
71
  "tsdown": "^0.20.3",
72
72
  "tsx": "^4.21.0",
73
73
  "typescript": "^5.9.3",
74
74
  "vitest": "^4.0.18",
75
- "eslint-plugin-oxfmt": "0.0.13"
75
+ "eslint-plugin-oxfmt": "0.0.14"
76
76
  },
77
77
  "engines": {
78
78
  "node": "^20.19.0 || >=22.12.0"
79
79
  },
80
80
  "nano-staged": {
81
- "*.{js,ts,mjs,cjs,md,vue,yml,yaml,toml,json}": "eslint --fix",
81
+ "*.{js,ts,mjs,tsx,md,vue,yml,yaml,toml,json}": "eslint --fix",
82
82
  "*": "oxfmt --no-error-on-unmatched-pattern"
83
83
  },
84
84
  "scripts": {
package/workers/oxfmt.mjs CHANGED
@@ -44,29 +44,29 @@ function applyOverrides(
44
44
  // Get relative path from cwd and normalize to forward slashes for cross-platform compatibility
45
45
  const relativePath = relative(cwd, filename).replace(/\\/g, '/')
46
46
 
47
- let mergedOptions = { ...baseOptions }
47
+ let mergedOptions = baseOptions
48
+ let hasOverrides = false
48
49
 
49
50
  // Apply overrides in order (later overrides take precedence)
50
51
  for (const override of overrides) {
51
52
  const { excludeFiles, files, options: overrideOptions } = override
52
53
 
53
54
  // Check if file matches the files patterns
54
- const isMatchFiles = picomatch(files)
55
- const matches = isMatchFiles(relativePath)
55
+ const matches = picomatch.isMatch(relativePath, files)
56
56
 
57
57
  // Check if file is excluded
58
- let excluded = false
59
- if (excludeFiles && excludeFiles.length > 0) {
60
- const isMatchExclude = picomatch(excludeFiles)
61
- excluded = isMatchExclude(relativePath)
62
- }
58
+ const excluded =
59
+ excludeFiles && excludeFiles.length > 0
60
+ ? picomatch.isMatch(relativePath, excludeFiles)
61
+ : false
63
62
 
64
63
  if (matches && !excluded && overrideOptions) {
65
64
  mergedOptions = { ...mergedOptions, ...overrideOptions }
65
+ hasOverrides = true
66
66
  }
67
67
  }
68
68
 
69
- return mergedOptions
69
+ return hasOverrides ? mergedOptions : baseOptions
70
70
  }
71
71
 
72
72
  runAsWorker(
@@ -79,7 +79,7 @@ runAsWorker(
79
79
  * @type {string} source text
80
80
  */
81
81
  sourceText,
82
- /**'
82
+ /**
83
83
  * @type {Options} format options
84
84
  */
85
85
  options,