Skip to content

feat(lang): format and lint Astro like Svelte - #46

Merged
aimuzov merged 3 commits into
mainfrom
feature/astro-support
Oct 15, 2026
Merged

aimuzov merged 3 commits into
mainfrom
feature/astro-support

Conversation

@aimuzov

@aimuzov aimuzov commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Astro gets the same treatment Svelte already had. Upstream `lang.astro` sets only `prettier` as the formatter.

  • Formatting: new override `overrides/lazyvim/lang-astro.lua` — with `lang.astro` and `formatting.prettier`, `.astro` files run `prettier` then `stylelint`.
  • Diagnostics: with `linting.eslint`, `stylelint_lsp` attaches to `astro`; the `linting.stylelint` extra validates `astro`.
  • Shared formatter: the stylelint conform formatter (project `node_modules/.bin/stylelint`, `--custom-syntax postcss-html` for markup files) moves from `lang-svelte.lua` to `util/stylelint.lua` and serves both languages.
  • DAP: `dap.vscode-js` configurations cover `astro`.
  • Docs: override counts 39 → 40 (LazyVim 9 → 10) across README, ARCHITECTURE, EXTRAS, FAQ.
  • `.gitignore`: the stale chezmoi path becomes `.luarc.json` (local LuaLS settings).

Also carries `fix(formatting): pick oxfmt only by its own config` from the same branch: the oxlint config alone no longer switches a project from prettier to oxfmt.

Test plan

  • `npm run format:check`, `npm run lint`
  • Real config, headless, on lazyvimx/site: `home.astro` → conform runs `prettier, stylelint` (project stylelint), formatting succeeds; LSP clients include `astro` and `stylelint_lsp`
  • Same check on `demo-player.svelte`: `prettier_svelte, stylelint`, unchanged behavior after the refactor

An .oxlintrc.json next to a Prettier setup marked the project as oxfmt-formatted, so Prettier stopped running on save and oxfmt took over ts files with its defaults and left astro unformatted. Only oxfmt's own config switches formatters now.
Astro files get prettier plus stylelint on format and stylelint_lsp diagnostics, the same way Svelte does. The stylelint formatter with postcss-html moves to util/stylelint.lua and serves both. The vscode-js debugger and the stylelint_lsp validate list know about astro too, and the docs now count 40 overrides.
@github-actions github-actions Bot added the enhancement New feature or request label Oct 15, 2026
The FAQ still said 50 extras while the code and the README have 51.
@aimuzov
aimuzov merged commit 9de0fd8 into main Oct 15, 2026
2 checks passed
@aimuzov
aimuzov deleted the feature/astro-support branch October 15, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant