astro-eslint-parser 0.7.0 → 0.7.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/lib/index.js CHANGED
@@ -1209,9 +1209,11 @@ function sortedLastIndex(array, value) {
1209
1209
  var service = __toESM(require("astrojs-compiler-sync"));
1210
1210
  function parse2(code, ctx) {
1211
1211
  const result = service.parse(code, { position: true });
1212
- for (const { code: code2, text, location } of result.diagnostics || []) {
1213
- ctx.originalAST = result.ast;
1214
- throw new ParseError(`[${code2}]: ${text}`, location.length, ctx);
1212
+ for (const { code: code2, text, location, severity } of result.diagnostics || []) {
1213
+ if (severity === 1) {
1214
+ ctx.originalAST = result.ast;
1215
+ throw new ParseError(`${text} [${code2}]`, location.length, ctx);
1216
+ }
1215
1217
  }
1216
1218
  if (!result.ast.children) {
1217
1219
  result.ast.children = [];
package/lib/index.mjs CHANGED
@@ -1180,9 +1180,11 @@ function sortedLastIndex(array, value) {
1180
1180
  import * as service from "astrojs-compiler-sync";
1181
1181
  function parse2(code, ctx) {
1182
1182
  const result = service.parse(code, { position: true });
1183
- for (const { code: code2, text, location } of result.diagnostics || []) {
1184
- ctx.originalAST = result.ast;
1185
- throw new ParseError(`[${code2}]: ${text}`, location.length, ctx);
1183
+ for (const { code: code2, text, location, severity } of result.diagnostics || []) {
1184
+ if (severity === 1) {
1185
+ ctx.originalAST = result.ast;
1186
+ throw new ParseError(`${text} [${code2}]`, location.length, ctx);
1187
+ }
1186
1188
  }
1187
1189
  if (!result.ast.children) {
1188
1190
  result.ast.children = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro-eslint-parser",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Astro component parser for ESLint",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.mjs",