@vue-jsx-vapor/eslint 2.4.3 → 2.4.5

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
@@ -48,7 +48,6 @@ const rule$1 = {
48
48
  const tabWidth = configuration.tabWidth || 2;
49
49
  return { CallExpression(node) {
50
50
  const callee = node.callee.type === "MemberExpression" ? node.callee.object : node.callee;
51
- const offset = callee.loc.start.column;
52
51
  const parser = node.callee.type === "MemberExpression" && node.callee.property.type === "Identifier" ? node.callee.property.name : "css";
53
52
  if (callee.type === "Identifier" && callee.name === "defineStyle") {
54
53
  const arg = node.arguments[0];
@@ -66,8 +65,14 @@ const rule$1 = {
66
65
  messageId: "define-style-syntax-error"
67
66
  });
68
67
  }
69
- const placeholder = " ".repeat(offset + tabWidth);
70
- const result = `\n${placeholder}${formattedCss.slice(0, -1).replaceAll("\n", `\n${placeholder}`)}\n${" ".repeat(offset)}`;
68
+ const line = callee.loc.start.line;
69
+ function getOffset(node$1) {
70
+ if (node$1.parent?.loc.start.line === line) return getOffset(node$1.parent);
71
+ return node$1.loc.start.column;
72
+ }
73
+ const column = getOffset(callee);
74
+ const placeholder = " ".repeat(column + tabWidth);
75
+ const result = `\n${placeholder}${formattedCss.slice(0, -1).replaceAll("\n", `\n${placeholder}`)}\n${" ".repeat(column)}`;
71
76
  if (result !== cssRaw) context.report({
72
77
  node: arg,
73
78
  messageId: "define-style",
package/dist/index.js CHANGED
@@ -24,7 +24,6 @@ const rule$1 = {
24
24
  const tabWidth = configuration.tabWidth || 2;
25
25
  return { CallExpression(node) {
26
26
  const callee = node.callee.type === "MemberExpression" ? node.callee.object : node.callee;
27
- const offset = callee.loc.start.column;
28
27
  const parser = node.callee.type === "MemberExpression" && node.callee.property.type === "Identifier" ? node.callee.property.name : "css";
29
28
  if (callee.type === "Identifier" && callee.name === "defineStyle") {
30
29
  const arg = node.arguments[0];
@@ -42,8 +41,14 @@ const rule$1 = {
42
41
  messageId: "define-style-syntax-error"
43
42
  });
44
43
  }
45
- const placeholder = " ".repeat(offset + tabWidth);
46
- const result = `\n${placeholder}${formattedCss.slice(0, -1).replaceAll("\n", `\n${placeholder}`)}\n${" ".repeat(offset)}`;
44
+ const line = callee.loc.start.line;
45
+ function getOffset(node$1) {
46
+ if (node$1.parent?.loc.start.line === line) return getOffset(node$1.parent);
47
+ return node$1.loc.start.column;
48
+ }
49
+ const column = getOffset(callee);
50
+ const placeholder = " ".repeat(column + tabWidth);
51
+ const result = `\n${placeholder}${formattedCss.slice(0, -1).replaceAll("\n", `\n${placeholder}`)}\n${" ".repeat(column)}`;
47
52
  if (result !== cssRaw) context.report({
48
53
  node: arg,
49
54
  messageId: "define-style",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-jsx-vapor/eslint",
3
- "version": "2.4.3",
3
+ "version": "2.4.5",
4
4
  "description": "Vue JSX Vapor ESLint Plugin",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -37,7 +37,7 @@
37
37
  "@prettier/sync": "^0.5.5"
38
38
  },
39
39
  "devDependencies": {
40
- "@typescript-eslint/utils": "^8.33.0",
40
+ "@typescript-eslint/utils": "^8.33.1",
41
41
  "eslint-vitest-rule-tester": "^2.2.0"
42
42
  },
43
43
  "scripts": {