Files
Andrew Powell af2d26c073 fix(linter/astro): handle js --- after frontmatter in .astro files (#22091)
Resolves https://github.com/oxc-project/oxc/issues/22090

## Summary
Fixes Astro frontmatter parsing so it stops at the first valid closing
`---` fence, instead of the last `---` anywhere in the file. This
prevents `---` inside template/script content from being treated as a
frontmatter delimiter.

## Changes included
- Updated `AstroPartialLoader` frontmatter parsing to recognize only
standalone fence lines, require the opening fence at file start
(ignoring whitespace), and pair it with the next valid closing fence.
- Returned the frontmatter end offset from parsing so subsequent script
extraction starts after frontmatter.
- Added a regression test covering `.astro` content where later
JS/template strings include `---`.

LLM Disclosure: This was developed by an agent on this PR
https://github.com/shellscape/oxc/pull/1, but supervised by a human
(me).

---------

Co-authored-by: charliecreates[bot] <198680274+charliecreates[bot]@users.noreply.github.com>
Co-authored-by: CharlieHelps <charlie@charlielabs.ai>
Co-authored-by: Cameron <cameron.clark@hey.com>
2026-05-03 20:16:06 +01:00
..
…