Skip to content

Fix TypeScript errors in code snippets of imports reference#14249

Merged
ArmandPhilippot merged 2 commits into
mainfrom
armand/fix-imports-reference-snippets
Jul 15, 2026
Merged

Fix TypeScript errors in code snippets of imports reference#14249
ArmandPhilippot merged 2 commits into
mainfrom
armand/fix-imports-reference-snippets

Conversation

@ArmandPhilippot

@ArmandPhilippot ArmandPhilippot commented Jul 15, 2026

Copy link
Copy Markdown
Member

Description (required)

Updates our Imports reference to:

  • Fix TypeScript errors
    • // comments are invalid in the template part, we need HTML or JSX comments (No one will probably copy/paste those, but we should show valid syntax)
    • CSS Modules: this is not a valid JSX example (return comes from nowhere), and this works too in an Astro file. So, converting the code snippet seems the easiest way.
    • Other Assets: <Image /> is not available in UI frameworks, so the code snippet should use an .astro file, and not jsx.
    • import.meta.glob: TypeScript complains about post., we need any + formatting
    • import.meta.glob: in the second snippet, TypeScript complains about component. Since we have a public type, I used it instead of any. I also converted the comment to a JSX one because the formatter wants to put the opening brace on the same line as the comment: -->{
    • Supported Values: we need two any to prevent TypeScript errors on post.* and myFeaturedPost.* + formatting
  • Use a consistent sentence case for headings (the only exception I haven't updated is "CSS Modules" because it seems this is the correct casing: https://github.com/css-modules/css-modules/tree/master)

References

@ArmandPhilippot ArmandPhilippot added code snippet update Updates a code sample: typo, outdated code etc. consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc. labels Jul 15, 2026
@astrobot-houston

Copy link
Copy Markdown
Contributor

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
en/guides/imports.mdx Source changed, localizations will be marked as outdated.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@ArmandPhilippot ArmandPhilippot merged commit a856a49 into main Jul 15, 2026
10 checks passed
@ArmandPhilippot ArmandPhilippot deleted the armand/fix-imports-reference-snippets branch July 15, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code snippet update Updates a code sample: typo, outdated code etc. consistency/formatting Standardizing without changing docs content e.g. indenting, lists etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants