Skip to content

feat: some sort of Astro support#2

Open
Princesseuh wants to merge 38 commits intomainfrom
feat/astro
Open

feat: some sort of Astro support#2
Princesseuh wants to merge 38 commits intomainfrom
feat/astro

Conversation

@Princesseuh
Copy link
Copy Markdown
Member

No description provided.

@autofix-troubleshooter
Copy link
Copy Markdown

Hi! I'm the autofix logoautofix.ci troubleshooter bot.

It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃


! eslint(no-debugger): `debugger` statement is not allowed
,-[fixtures/astro/debugger.astro:11:3]
10 | <script asdf >
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to change script handling to match current compiler, we should still parse as JS if there's attributes unless they're type="something" we don't know.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the same issue or something else now.

16 | <script>
! eslint(no-unused-vars): Variable 'unusedVariable2' is declared but never used. Unused variables should start with a '_'.
,-[test.astro:18:7]
17 | // eslint-disable-next-line no-unused-vars
Copy link
Copy Markdown
Member Author

@Princesseuh Princesseuh Feb 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like those comments don't work anymore, they're probably at the wrong offset if I were to guess.

/// HTML comment `<!-- ... -->`
/// Used in Astro files
#[estree(rename = "Html")]
Html = 3,
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up adding HTML comments as a Astro element instead of a comment type, because I thought I couldn't print trivias, but reading through some more code it seems like you can somehow, so perhaps it could've stayed a trivia to avoid parsing changes. To investigate

Comment on lines +2612 to +2614
p.print_str("<!doctype ");
p.print_str(doctype.value.as_str());
p.print_str(">");
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be also in a print method on the type

mut out_sections: Option<&mut SectionContents<'a>>,
) -> SmallVec<[Result<ResolvedModuleRecord, Vec<OxcDiagnostic>>; 1]> {
// Special handling for Astro files - use full AST parsing
#[cfg(feature = "astro")]
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this doesn't need to be here since Astro is natively supported? This function seems to be about partial languages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants