astro-eslint-parser 1.0.2 → 1.0.3

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/lib/index.d.mts CHANGED
@@ -314,7 +314,7 @@ declare class ParseError extends SyntaxError {
314
314
  }
315
315
 
316
316
  var name = "astro-eslint-parser";
317
- var version = "1.0.2";
317
+ var version = "1.0.3";
318
318
 
319
319
  declare const meta_name: typeof name;
320
320
  declare const meta_version: typeof version;
package/lib/index.d.ts CHANGED
@@ -314,7 +314,7 @@ declare class ParseError extends SyntaxError {
314
314
  }
315
315
 
316
316
  var name = "astro-eslint-parser";
317
- var version = "1.0.2";
317
+ var version = "1.0.3";
318
318
 
319
319
  declare const meta_name: typeof name;
320
320
  declare const meta_version: typeof version;
package/lib/index.js CHANGED
@@ -123,8 +123,7 @@ var TSService = class {
123
123
  filePath: normalized
124
124
  };
125
125
  for (const { filePath: targetPath } of [this.currTarget, lastTarget]) {
126
- if (!targetPath)
127
- continue;
126
+ if (!targetPath) continue;
128
127
  this.fileWatchCallbacks.get(targetPath)?.update();
129
128
  }
130
129
  const program = this.watch.getProgram().getProgram();
@@ -496,12 +495,10 @@ function getTSParserNameFromObject(value) {
496
495
  return null;
497
496
  }
498
497
  function isTSESLintParserObject(value) {
499
- if (!isEnhancedParserObject(value))
500
- return false;
498
+ if (!isEnhancedParserObject(value)) return false;
501
499
  if (value.name === "typescript-eslint-parser-for-extra-files")
502
500
  return true;
503
- if (value.meta?.name === "typescript-eslint/parser")
504
- return true;
501
+ if (value.meta?.name === "typescript-eslint/parser") return true;
505
502
  try {
506
503
  const result = value.parseForESLint("", {});
507
504
  const services = result.services;
@@ -755,8 +752,7 @@ function removeIdentifierVariable(node, scope) {
755
752
  if (variable.defs.length === 0) {
756
753
  referencesToThrough(variable.references, scope);
757
754
  variable.references.forEach((r) => {
758
- if (r.init)
759
- r.init = false;
755
+ if (r.init) r.init = false;
760
756
  r.resolved = null;
761
757
  });
762
758
  scope.variables.splice(varIndex, 1);
@@ -1161,12 +1157,9 @@ function getEndOffset(node, ctx) {
1161
1157
  if (node.position.end?.offset != null) {
1162
1158
  return node.position.end.offset;
1163
1159
  }
1164
- if (isTag(node))
1165
- return calcTagEndOffset(node, ctx);
1166
- if (node.type === "expression")
1167
- return calcExpressionEndOffset(node, ctx);
1168
- if (node.type === "comment")
1169
- return calcCommentEndOffset(node, ctx);
1160
+ if (isTag(node)) return calcTagEndOffset(node, ctx);
1161
+ if (node.type === "expression") return calcExpressionEndOffset(node, ctx);
1162
+ if (node.type === "comment") return calcCommentEndOffset(node, ctx);
1170
1163
  if (node.type === "frontmatter") {
1171
1164
  const start = node.position.start.offset;
1172
1165
  return ctx.code.indexOf("---", start + 3) + 3;
@@ -1344,8 +1337,7 @@ function getTokenInfo(ctx, tokens, position) {
1344
1337
  };
1345
1338
  function getHTMLEntity(position3) {
1346
1339
  let codeOffset2 = position3;
1347
- if (ctx.code[codeOffset2++] !== "&")
1348
- return null;
1340
+ if (ctx.code[codeOffset2++] !== "&") return null;
1349
1341
  let entity = "";
1350
1342
  const entityDecoder = new import_decode.EntityDecoder(
1351
1343
  import_decode.htmlDecodeTree,
@@ -2818,7 +2810,7 @@ __export(meta_exports, {
2818
2810
 
2819
2811
  // package.json
2820
2812
  var name = "astro-eslint-parser";
2821
- var version = "1.0.2";
2813
+ var version = "1.0.3";
2822
2814
 
2823
2815
  // src/index.ts
2824
2816
  function parseForESLint2(code, options) {
package/lib/index.mjs CHANGED
@@ -2,8 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
3
3
  get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
4
4
  }) : x)(function(x) {
5
- if (typeof require !== "undefined")
6
- return require.apply(this, arguments);
5
+ if (typeof require !== "undefined") return require.apply(this, arguments);
7
6
  throw Error('Dynamic require of "' + x + '" is not supported');
8
7
  });
9
8
  var __export = (target, all) => {
@@ -93,8 +92,7 @@ var TSService = class {
93
92
  filePath: normalized
94
93
  };
95
94
  for (const { filePath: targetPath } of [this.currTarget, lastTarget]) {
96
- if (!targetPath)
97
- continue;
95
+ if (!targetPath) continue;
98
96
  this.fileWatchCallbacks.get(targetPath)?.update();
99
97
  }
100
98
  const program = this.watch.getProgram().getProgram();
@@ -466,12 +464,10 @@ function getTSParserNameFromObject(value) {
466
464
  return null;
467
465
  }
468
466
  function isTSESLintParserObject(value) {
469
- if (!isEnhancedParserObject(value))
470
- return false;
467
+ if (!isEnhancedParserObject(value)) return false;
471
468
  if (value.name === "typescript-eslint-parser-for-extra-files")
472
469
  return true;
473
- if (value.meta?.name === "typescript-eslint/parser")
474
- return true;
470
+ if (value.meta?.name === "typescript-eslint/parser") return true;
475
471
  try {
476
472
  const result = value.parseForESLint("", {});
477
473
  const services = result.services;
@@ -734,8 +730,7 @@ function removeIdentifierVariable(node, scope) {
734
730
  if (variable.defs.length === 0) {
735
731
  referencesToThrough(variable.references, scope);
736
732
  variable.references.forEach((r) => {
737
- if (r.init)
738
- r.init = false;
733
+ if (r.init) r.init = false;
739
734
  r.resolved = null;
740
735
  });
741
736
  scope.variables.splice(varIndex, 1);
@@ -1144,12 +1139,9 @@ function getEndOffset(node, ctx) {
1144
1139
  if (node.position.end?.offset != null) {
1145
1140
  return node.position.end.offset;
1146
1141
  }
1147
- if (isTag(node))
1148
- return calcTagEndOffset(node, ctx);
1149
- if (node.type === "expression")
1150
- return calcExpressionEndOffset(node, ctx);
1151
- if (node.type === "comment")
1152
- return calcCommentEndOffset(node, ctx);
1142
+ if (isTag(node)) return calcTagEndOffset(node, ctx);
1143
+ if (node.type === "expression") return calcExpressionEndOffset(node, ctx);
1144
+ if (node.type === "comment") return calcCommentEndOffset(node, ctx);
1153
1145
  if (node.type === "frontmatter") {
1154
1146
  const start = node.position.start.offset;
1155
1147
  return ctx.code.indexOf("---", start + 3) + 3;
@@ -1327,8 +1319,7 @@ function getTokenInfo(ctx, tokens, position) {
1327
1319
  };
1328
1320
  function getHTMLEntity(position3) {
1329
1321
  let codeOffset2 = position3;
1330
- if (ctx.code[codeOffset2++] !== "&")
1331
- return null;
1322
+ if (ctx.code[codeOffset2++] !== "&") return null;
1332
1323
  let entity = "";
1333
1324
  const entityDecoder = new EntityDecoder(
1334
1325
  htmlDecodeTree,
@@ -2801,7 +2792,7 @@ __export(meta_exports, {
2801
2792
 
2802
2793
  // package.json
2803
2794
  var name = "astro-eslint-parser";
2804
- var version = "1.0.2";
2795
+ var version = "1.0.3";
2805
2796
 
2806
2797
  // src/index.ts
2807
2798
  function parseForESLint2(code, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-eslint-parser",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Astro component parser for ESLint",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",
@@ -49,9 +49,9 @@
49
49
  "homepage": "https://github.com/ota-meshi/astro-eslint-parser#readme",
50
50
  "dependencies": {
51
51
  "@astrojs/compiler": "^2.0.0",
52
- "@typescript-eslint/scope-manager": "^7.0.0",
53
- "@typescript-eslint/types": "^7.0.0",
54
- "@typescript-eslint/typescript-estree": "^7.0.0",
52
+ "@typescript-eslint/scope-manager": "^7.0.0 || ^8.0.0",
53
+ "@typescript-eslint/types": "^7.0.0 || ^8.0.0",
54
+ "@typescript-eslint/typescript-estree": "^7.0.0 || ^8.0.0",
55
55
  "astrojs-compiler-sync": "^1.0.0",
56
56
  "debug": "^4.3.4",
57
57
  "entities": "^4.5.0",
@@ -69,21 +69,21 @@
69
69
  "@types/benchmark": "^2.1.1",
70
70
  "@types/chai": "^4.3.0",
71
71
  "@types/debug": "^4.1.7",
72
- "@types/eslint": "^8.0.0",
72
+ "@types/eslint": "^9.0.0",
73
73
  "@types/eslint-scope": "^3.7.0",
74
74
  "@types/eslint-visitor-keys": "^3.0.0",
75
75
  "@types/is-glob": "^4.0.4",
76
76
  "@types/mocha": "^10.0.0",
77
77
  "@types/node": "^20.0.0",
78
78
  "@types/semver": "^7.3.9",
79
- "@typescript-eslint/eslint-plugin": "^7.7.1",
80
- "@typescript-eslint/parser": "^7.7.1",
79
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
80
+ "@typescript-eslint/parser": "^8.0.0",
81
81
  "astro": "^4.0.0",
82
82
  "astro-eslint-parser": ">=0.1.0",
83
83
  "benchmark": "^2.1.4",
84
84
  "chai": "^5.0.0",
85
85
  "env-cmd": "^10.1.0",
86
- "esbuild": "^0.20.0",
86
+ "esbuild": "^0.23.0",
87
87
  "esbuild-register": "^3.3.3",
88
88
  "eslint": "^8.15.0",
89
89
  "eslint-config-prettier": "^9.0.0",
@@ -106,15 +106,15 @@
106
106
  "magic-string": "^0.30.0",
107
107
  "mocha": "^10.0.0",
108
108
  "mocha-chai-jest-snapshot": "^1.1.3",
109
- "nyc": "^15.1.0",
109
+ "nyc": "^17.0.0",
110
110
  "prettier": "^3.0.0",
111
- "prettier-plugin-astro": "^0.13.0",
111
+ "prettier-plugin-astro": "^0.14.0",
112
112
  "prettier-plugin-svelte": "^3.0.0",
113
113
  "string-replace-loader": "^3.0.3",
114
114
  "svelte": "^4.0.0",
115
115
  "tsup": "^8.0.0",
116
- "typescript": "~5.4.0",
117
- "typescript-eslint-parser-for-extra-files": "^0.6.0"
116
+ "typescript": "~5.6.0",
117
+ "typescript-eslint-parser-for-extra-files": "^0.7.0"
118
118
  },
119
119
  "publishConfig": {
120
120
  "access": "public"