@unocss/eslint-plugin 66.6.0 → 66.6.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/dist/index.cjs CHANGED
@@ -26,10 +26,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  }) : target, mod));
27
27
 
28
28
  //#endregion
29
- const require_dirs = require('./dirs-DMLliOn8.cjs');
30
29
  let node_path = require("node:path");
31
30
  let _typescript_eslint_utils = require("@typescript-eslint/utils");
32
31
  let synckit = require("synckit");
32
+ let node_url = require("node:url");
33
33
  let magic_string = require("magic-string");
34
34
  magic_string = __toESM(magic_string);
35
35
  let _typescript_eslint_types = require("@typescript-eslint/types");
@@ -38,9 +38,13 @@ let _typescript_eslint_types = require("@typescript-eslint/types");
38
38
  const CLASS_FIELDS = ["class", "classname"];
39
39
  const AST_NODES_WITH_QUOTES = ["Literal", "VLiteral"];
40
40
 
41
+ //#endregion
42
+ //#region src/dirs.ts
43
+ const distDir = (0, node_url.fileURLToPath)(new URL("../dist", require("url").pathToFileURL(__filename).href));
44
+
41
45
  //#endregion
42
46
  //#region src/rules/_.ts
43
- const syncAction = (0, synckit.createSyncFn)((0, node_path.join)(require_dirs.distDir, "worker.mjs"));
47
+ const syncAction = (0, synckit.createSyncFn)((0, node_path.join)(distDir, "worker.mjs"));
44
48
  const createRule = _typescript_eslint_utils.ESLintUtils.RuleCreator(() => "https://unocss.dev/integrations/eslint#rules");
45
49
 
46
50
  //#endregion
@@ -76,9 +80,8 @@ var order_attributify_default = createRule({
76
80
  node,
77
81
  messageId: "invalid-order",
78
82
  fix(fixer) {
79
- const codeFull = context.getSourceCode();
80
83
  const offset = node.range[0];
81
- const s = new magic_string.default(codeFull.getText().slice(node.range[0], node.range[1]));
84
+ const s = new magic_string.default(context.sourceCode.getText().slice(node.range[0], node.range[1]));
82
85
  const sortedNodes = valueless.map((i) => [i.range[0] - offset, i.range[1] - offset]).sort((a, b) => b[0] - a[0]);
83
86
  for (const [start, end] of sortedNodes.slice(1)) s.remove(start, end);
84
87
  s.overwrite(sortedNodes[0][0], sortedNodes[0][1], ` ${sorted.trim()} `);
@@ -477,6 +480,5 @@ var src_default = {
477
480
  };
478
481
 
479
482
  //#endregion
480
- exports.__toESM = __toESM;
481
483
  exports.configs = configs;
482
484
  exports.default = src_default;
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { t as distDir } from "./dirs-DTjbV7PE.mjs";
2
1
  import { join } from "node:path";
3
2
  import { ESLintUtils } from "@typescript-eslint/utils";
4
3
  import { createSyncFn } from "synckit";
4
+ import { fileURLToPath } from "node:url";
5
5
  import MagicString from "magic-string";
6
6
  import { AST_TOKEN_TYPES } from "@typescript-eslint/types";
7
7
 
@@ -9,6 +9,10 @@ import { AST_TOKEN_TYPES } from "@typescript-eslint/types";
9
9
  const CLASS_FIELDS = ["class", "classname"];
10
10
  const AST_NODES_WITH_QUOTES = ["Literal", "VLiteral"];
11
11
 
12
+ //#endregion
13
+ //#region src/dirs.ts
14
+ const distDir = fileURLToPath(new URL("../dist", import.meta.url));
15
+
12
16
  //#endregion
13
17
  //#region src/rules/_.ts
14
18
  const syncAction = createSyncFn(join(distDir, "worker.mjs"));
@@ -47,9 +51,8 @@ var order_attributify_default = createRule({
47
51
  node,
48
52
  messageId: "invalid-order",
49
53
  fix(fixer) {
50
- const codeFull = context.getSourceCode();
51
54
  const offset = node.range[0];
52
- const s = new MagicString(codeFull.getText().slice(node.range[0], node.range[1]));
55
+ const s = new MagicString(context.sourceCode.getText().slice(node.range[0], node.range[1]));
53
56
  const sortedNodes = valueless.map((i) => [i.range[0] - offset, i.range[1] - offset]).sort((a, b) => b[0] - a[0]);
54
57
  for (const [start, end] of sortedNodes.slice(1)) s.remove(start, end);
55
58
  s.overwrite(sortedNodes[0][0], sortedNodes[0][1], ` ${sorted.trim()} `);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unocss/eslint-plugin",
3
3
  "type": "module",
4
- "version": "66.6.0",
4
+ "version": "66.6.1",
5
5
  "description": "ESLint plugin for UnoCSS",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -22,19 +22,23 @@
22
22
  "sideEffects": false,
23
23
  "exports": {
24
24
  ".": {
25
- "import": {
26
- "types": "./dist/index.d.mts",
27
- "default": "./dist/index.mjs"
28
- },
29
- "require": {
30
- "types": "./dist/index.d.cts",
31
- "default": "./dist/index.cjs"
32
- }
25
+ "require": "./dist/index.cjs",
26
+ "import": "./dist/index.mjs"
27
+ },
28
+ "./worker": "./dist/worker.mjs",
29
+ "./package.json": "./package.json"
30
+ },
31
+ "main": "./dist/index.cjs",
32
+ "module": "./dist/index.mjs",
33
+ "types": "./dist/index.d.cts",
34
+ "typesVersions": {
35
+ "*": {
36
+ "*": [
37
+ "./dist/*.d.mts",
38
+ "./*"
39
+ ]
33
40
  }
34
41
  },
35
- "main": "dist/index.cjs",
36
- "module": "dist/index.mjs",
37
- "types": "dist/index.d.mts",
38
42
  "files": [
39
43
  "dist"
40
44
  ],
@@ -42,18 +46,18 @@
42
46
  "node": ">=14"
43
47
  },
44
48
  "dependencies": {
45
- "@typescript-eslint/utils": "^8.53.0",
49
+ "@typescript-eslint/utils": "^8.56.1",
46
50
  "magic-string": "^0.30.21",
47
51
  "synckit": "^0.11.12",
48
- "@unocss/config": "66.6.0",
49
- "@unocss/core": "66.6.0",
50
- "@unocss/rule-utils": "66.6.0"
52
+ "@unocss/config": "66.6.1",
53
+ "@unocss/core": "66.6.1",
54
+ "@unocss/rule-utils": "66.6.1"
51
55
  },
52
56
  "devDependencies": {
53
57
  "@typescript/native-preview": "latest",
54
- "svelte-eslint-parser": "^1.4.1",
55
- "vue-eslint-parser": "^10.2.0",
56
- "@unocss/eslint-plugin": "66.6.0"
58
+ "svelte-eslint-parser": "^1.5.1",
59
+ "vue-eslint-parser": "^10.4.0",
60
+ "@unocss/eslint-plugin": "66.6.1"
57
61
  },
58
62
  "scripts": {
59
63
  "build": "tsdown --config-loader unrun",
@@ -1,13 +0,0 @@
1
- const require_index = require('./index.cjs');
2
- let node_url = require("node:url");
3
-
4
- //#region src/dirs.ts
5
- const distDir = (0, node_url.fileURLToPath)(new URL("../dist", require("url").pathToFileURL(__filename).href));
6
-
7
- //#endregion
8
- Object.defineProperty(exports, 'distDir', {
9
- enumerable: true,
10
- get: function () {
11
- return distDir;
12
- }
13
- });
@@ -1,7 +0,0 @@
1
- import { fileURLToPath } from "node:url";
2
-
3
- //#region src/dirs.ts
4
- const distDir = fileURLToPath(new URL("../dist", import.meta.url));
5
-
6
- //#endregion
7
- export { distDir as t };
package/dist/dirs.cjs DELETED
@@ -1,3 +0,0 @@
1
- const require_dirs = require('./dirs-DMLliOn8.cjs');
2
-
3
- exports.distDir = require_dirs.distDir;
package/dist/dirs.d.cts DELETED
@@ -1,4 +0,0 @@
1
- //#region src/dirs.d.ts
2
- declare const distDir: string;
3
- //#endregion
4
- export { distDir };
package/dist/dirs.d.mts DELETED
@@ -1,4 +0,0 @@
1
- //#region src/dirs.d.ts
2
- declare const distDir: string;
3
- //#endregion
4
- export { distDir };
package/dist/dirs.mjs DELETED
@@ -1,3 +0,0 @@
1
- import { t as distDir } from "./dirs-DTjbV7PE.mjs";
2
-
3
- export { distDir };