Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://unpkg.com/@changesets/config@1.6.0/schema.json",
"$schema": "https://unpkg.com/@changesets/config@4.0.0/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"linked": [],
Expand Down
5 changes: 5 additions & 0 deletions .changeset/olive-poems-shake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'prettier-plugin-astro': major
---

Raises the minimum supported Node version to 22.12.0.
8 changes: 1 addition & 7 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
{
"mode": "pre",
"tag": "beta",
"initialVersions": {
"prettier-plugin-astro": "0.14.2"
},
"changesets": [
"pink-donkeys-shave"
]
"tag": "beta"
}
File renamed without changes.
7 changes: 3 additions & 4 deletions .github/actions/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ inputs:
node-version:
description: 'Node version'
required: false
type: number
default: latest
default: '24'

runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v3
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6.0.10

- name: Setup Node ${{ inputs.node-version }}
uses: actions/setup-node@v4
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ inputs.node-version }}
cache: pnpm
Expand Down
55 changes: 45 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,42 @@ on:
- next
pull_request:

permissions: {}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node_version: [18, 20]
node_version: [22, 24]
# We only test Node 22 on macOS and Windows to reduce CI usage.
include:
- os: windows-latest
node_version: 18
node_version: 22
- os: macos-latest
node_version: 18
node_version: 22
fail-fast: false
env:
LANG: en-us
name: 'Test: node-${{ matrix.node_version }}, ${{ matrix.os }}'
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Check out code using Git
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install Tools & Dependencies
uses: ./.github/actions/install
with:
node-version: ${{ matrix.node_version }}

- name: Build prettier-plugin-astro
run: pnpm build
Expand All @@ -38,15 +52,36 @@ jobs:

lint:
runs-on: ubuntu-latest
name: 'Lint: node-16, ubuntu-latest'
name: 'Lint'
timeout-minutes: 10
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Check out code using Git
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install Tools & Dependencies
uses: ./.github/actions/install

- name: Build prettier-plugin-astro
run: pnpm build

- name: Lint
run: pnpm lint
run: pnpm run lint:ci

typecheck:
runs-on: ubuntu-latest
name: 'Typecheck'
timeout-minutes: 10
permissions:
contents: read
steps:
- name: Check out code using Git
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- name: Install Tools & Dependencies
uses: ./.github/actions/install

- name: Typecheck
run: pnpm run typecheck
5 changes: 4 additions & 1 deletion .github/workflows/congrats.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
push:
branches: [main]

permissions: {}

jobs:
congrats:
name: congratsbot
if: ${{ github.repository_owner == 'withastro' && github.event.head_commit.message != '[ci] format' }}
uses: withastro/automation/.github/workflows/congratsbot.yml@main
uses: withastro/automation/.github/workflows/congratsbot.yml@39c495d03416085561ee8b93a4f8ecdf94290bb8 # main
with:
EMOJIS: '💐,🌼,🌻,🌹,🌺,🪷,🌷,🏵️'
secrets:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
jobs:
prettier:
if: github.repository_owner == 'withastro'
uses: withastro/automation/.github/workflows/format.yml@main
uses: withastro/automation/.github/workflows/format.yml@39c495d03416085561ee8b93a4f8ecdf94290bb8 # main
with:
command: "format"
command: 'format'
secrets: inherit
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,21 @@ on:
branches:
- main

permissions: {}

jobs:
release:
name: Changelog
if: github.repository_owner == 'withastro'
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: write
pull-requests: write
id-token: write # Required for npm trusted publishing
steps:
- name: Check out branch
uses: actions/checkout@v4
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0 # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits

Expand All @@ -25,12 +28,9 @@ jobs:

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
uses: changesets/action@198f833dd7d863100ea6e28967bc9a9fdefadb0a # v2.1.0
with:
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: '' # Empty so the action leaves npm auth to trusted publishing
publish-script: pnpm release

- name: push main branch to latest branch
if: steps.changesets.outputs.published == 'true'
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
.DS_Store
*.log
.eslintcache
5 changes: 2 additions & 3 deletions .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ tasks:
command: pnpm build
vscode:
extensions:
# TODO Once astro is on [vsx](https://open-vsx.org/), we should be able to specify it as an extension as well!
# https://www.gitpod.io/docs/vscode-extensions
- https://marketplace.visualstudio.com/_apis/public/gallery/publishers/astro-build/vsextensions/astro-vscode/0.7.13/vspackage
- astro-build.astro-vscode
- esbenp.prettier-vscode
- dbaeumer.vscode-eslint
- biomejs.biome
github:
prebuilds:
# enable for the master/default branch (defaults to true)
Expand Down
7 changes: 5 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"recommendations": [
"astro-build.astro-vscode",
"esbenp.prettier-vscode",
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"EditorConfig.EditorConfig"
]
"biomejs.biome"
],
"unwantedRecommendations": []
}
51 changes: 0 additions & 51 deletions biome.json

This file was deleted.

95 changes: 95 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.8/schema.json",
"files": {
"includes": ["**", "!!**/dist", "!!**/fixtures", "!!**/vendor"]
},
"vcs": {
"enabled": true,
"clientKind": "git",
"useIgnoreFile": true
},
"formatter": {
"indentStyle": "tab",
"indentWidth": 2,
"lineWidth": 100,
"includes": ["**", "!**/.changeset/**", "!**/pnpm-lock.yaml", "!**/*.astro"],
"expand": "auto"
},
"assist": {
"actions": {
"source": {
"organizeImports": "on",
"useSortedPackageJson": "on"
}
}
},
"linter": {
"enabled": true,
"domains": {
"test": "recommended"
},
"rules": {
"preset": "none",
"style": {
"useNodejsImportProtocol": "error",
// Enforce separate type imports for type-only imports to avoid bundling unneeded code
"useImportType": "error",
"useExportType": "error"
},
"suspicious": {
// This one is specific to catch `console.log`. The rest of logs are permitted
"noConsole": {
"level": "warn",
"options": {
"allow": ["error", "warn", "info", "debug"]
}
},
"noVar": "error",
"noDoubleEquals": "error",
"noDebugger": "error",
"noDuplicateCase": "error"
},
"correctness": {
"noUnusedVariables": {
"level": "error",
"options": {
"ignoreRestSiblings": true
}
},
"noUnusedFunctionParameters": "error",
"noUnusedImports": "error",
"noUnreachable": "error",
"noConstructorReturn": "error",
"noEmptyPattern": "error"
}
}
},
"javascript": {
"formatter": {
"trailingCommas": "all",
"quoteStyle": "single",
"semicolons": "always"
}
},
"json": {
"parser": {
"allowComments": true,
"allowTrailingCommas": true
},
"formatter": {
"indentStyle": "space",
"trailingCommas": "none"
}
},
"overrides": [
{
// Workaround to format files like npm does
"includes": ["**/package.json"],
"json": {
"formatter": {
"expand": "always"
}
}
}
]
}
Loading