• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ota-meshi / astro-eslint-parser / 29175963174

12 Jul 2026 01:54AM UTC coverage: 81.67% (-0.1%) from 81.788%
29175963174

push

github

web-flow
feat!: use `@astrojs/compiler-rs` instead of `@astrojs/compiler` (#435)

* feat!: use `@astrojs/compiler-rs` instead of `@astrojs/compiler`

* Create kind-plants-drive.md

* fix: ts errors

* fix

* update

* update

* update

* fix: typings

* fix

* fix

* fix: some bugs

* update

* update

651 of 867 branches covered (75.09%)

Branch coverage included in aggregate %.

349 of 395 new or added lines in 9 files covered. (88.35%)

6 existing lines in 4 files now uncovered.

1256 of 1468 relevant lines covered (85.56%)

52551.49 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.65
/src/parser/template.ts
1
import type { ParseResult } from "../astro/types";
2,890!
2
import { Context } from "../context";
1✔
3
import { ParseError } from "../errors";
1✔
4
import { parse as parseAstro } from "./astro-parser/parse";
1✔
5
import { LruCache } from "./lru-cache";
1✔
6

7
export type TemplateResult = {
8
  result: ParseResult;
9
  context: Context;
10
};
11

12
const lruCache = new LruCache<string, TemplateResult>(5);
1✔
13

14
/**
15
 * Parse the astro component template.
16
 */
17
export function parseTemplate(code: string, filePath?: string): TemplateResult {
2!
18
  const cache = lruCache.get(code);
1,435✔
19
  if (cache) {
1,435✔
20
    return cache;
1,141✔
21
  }
22
  const ctx = new Context(code, filePath);
294✔
23
  try {
294✔
24
    const result = parseAstro(code, ctx);
294✔
25

26
    const templateResult = {
293✔
27
      result,
28
      context: ctx,
29
    };
30
    lruCache.set(code, templateResult);
293✔
31
    return templateResult;
293✔
32
  } catch (e: any) {
33
    if (typeof e.pos === "number") {
1!
NEW
34
      const err = new ParseError(e.message, e.pos, ctx);
×
35
      (err as any).astroCompilerError = e;
×
36
      throw err;
×
37
    }
38
    throw e;
1✔
39
  }
40
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc