Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
eea30cd
feat!: drop nodejs v18 support
azat-io Aug 10, 2025
7f24360
feat!: move to esm only
azat-io Aug 10, 2025
3f840fc
chore: update dependencies
azat-io Aug 10, 2025
50cbf85
chore: use esm-compatible dirname in vite config
azat-io Aug 10, 2025
0d7c6c2
feat(sort-decorators): add array-based custom groups api
hugop95 Sep 10, 2025
7298b83
feat!: drop group kind support
hugop95 Sep 13, 2025
4988fce
feat(sort-heritage-clauses): add array-based custom groups api
hugop95 Sep 13, 2025
c174d95
chore: update dependencies
azat-io Sep 13, 2025
377292d
feat(sort-imports)!: drop deprecated ts config root dir support
hugop95 Sep 13, 2025
a46deab
feat!: drop deprecated selectors support for multiple rules
hugop95 Sep 13, 2025
8834f41
feat!: drop deprecated object-based custom groups support
hugop95 Sep 14, 2025
20b6577
feat: support annotation-based config
hugop95 Sep 14, 2025
61cabe0
feat(sort-object-types)!: drop deprecated ignore pattern option
hugop95 Sep 19, 2025
9521e9f
feat(sort-jsx-props)!: drop deprecated ignore pattern option
hugop95 Sep 19, 2025
a2ffa76
feat: add sort-import-attributes rule
azat-io Sep 19, 2025
cab4d0f
feat: add sort-export-attributes rule
azat-io Sep 19, 2025
1779615
chore: update dependencies
azat-io Sep 19, 2025
f312706
feat(sort-object)!: drop deprecated destructure only option
hugop95 Sep 22, 2025
ee31e2b
fix: fix plugin usage with legacy configurations
azat-io Sep 25, 2025
ae9817b
chore: update dependencies
azat-io Sep 25, 2025
cd117fa
feat(sort-objects): add pattern matching for variable declarations
hugop95 Sep 27, 2025
0c01411
chore: update dependencies
azat-io Oct 2, 2025
a01b8f3
fix: keep settings priority when meta default options provided
azat-io Oct 2, 2025
576712c
chore: update eslint plugin
azat-io Oct 2, 2025
b0c8408
refactor: move typescript eslint types to dev dependencies
azat-io Oct 4, 2025
a5626e8
feat!: drop deprecated newlines between always and never
hugop95 Oct 7, 2025
65cd8ed
feat(sort-objects)!: migrate object type options to conditional confi…
hugop95 Oct 14, 2025
a65b39e
feat(sort-enums)!: replace force numeric sort and update default sort…
hugop95 Oct 14, 2025
0bc49f4
feat(sort-objects): add numeric keys detection option
hugop95 Oct 30, 2025
102a018
feat(sort-object-types): add numeric keys detection option
hugop95 Oct 31, 2025
e7d8f33
docs: fix memory leaks on website
azat-io Oct 31, 2025
f56267f
docs: add search
azat-io Nov 1, 2025
03eb5de
docs: fix astro warnings
azat-io Nov 1, 2025
5032f1d
chore: update dependencies
azat-io Nov 2, 2025
590ce8e
feat(sort-imports): add multiline and singleline modifiers
hugop95 Nov 9, 2025
8f2126c
feat!: improve comment above integration in groups
hugop95 Nov 16, 2025
d0b38b9
fix: require sorting type in fallback sort schema
hugop95 Nov 16, 2025
513d13e
feat: allow type overrides in groups option
hugop95 Nov 17, 2025
98404bf
feat(sort-imports)!: drop deprecated selectors
hugop95 Nov 18, 2025
f9919cb
feat: allow order overrides in groups option
hugop95 Nov 18, 2025
885b3a8
feat: allow new lines inside overrides in groups option
hugop95 Nov 21, 2025
4977783
chore: update github actions
azat-io Nov 22, 2025
4e03287
chore: update dependencies
azat-io Nov 22, 2025
0403705
docs: enable svg optimization
azat-io Nov 22, 2025
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
3 changes: 3 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
"changelogen",
"changelogithub",
"crosspost",
"frontmatter",
"grotesk",
"humanwhocodes",
"joshuakgoldberg",
"keyux",
"libc",
"lightningcss",
"mdast",
"mdxjs",
"minisearch",
"nanostores",
"nocomment",
"pcss",
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/install-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
echo "PNPM_STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@638ed79f9dc94c1de1baef91bcab5edaa19451f4 # v4.2.4
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ${{ env.PNPM_STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/install-tools/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ runs:
using: composite
steps:
- name: Install Node
uses: actions/setup-node@d7a11313b581b306c961b506cfc8971208bb03f6 # v4.4.0
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: 24

- name: Install pnpm
uses: pnpm/action-setup@f2b2b233b538f500472c7274c7012f57857d8ce0 # v4.1.0
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
with:
version: 10
run_install: false
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0

Expand All @@ -26,7 +26,7 @@ jobs:
run: pnpm run docs:build

- name: Deploy to Netlify
uses: nwtgck/actions-netlify@f242d4c9f946f94d2ed8413888eaf35e1f7e848d # v3.0.0
uses: nwtgck/actions-netlify@4cbaf4c08f1a7bfa537d6113472ef4424e4eb654 # v3.0.0
with:
publish-dir: './dist'
production-branch: main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
fetch-depth: 0

Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -30,7 +30,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -47,7 +47,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -64,7 +64,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -81,7 +81,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -98,7 +98,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -115,7 +115,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -132,7 +132,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -149,7 +149,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Install Tools
uses: ./.github/actions/install-tools
Expand All @@ -161,6 +161,6 @@ jobs:
run: pnpm test:unit

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@3cb13a12348ef4ffcf9783ac0f74954f92113e33 # v5.5.0
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
32 changes: 13 additions & 19 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ let site = 'https://perfectionist.dev'

export default defineConfig({
markdown: {
shikiConfig: {
transformers: [
// @ts-ignore
transformerNotationDiff({
matchAlgorithm: 'v3',
}),
],
theme: colorTheme,
},
rehypePlugins: [
[
rehypeExternalLinks,
Expand All @@ -37,6 +28,14 @@ export default defineConfig({
},
],
],
shikiConfig: {
transformers: [
transformerNotationDiff({
matchAlgorithm: 'v3',
}),
],
theme: colorTheme,
},
remarkPlugins: [remarkSectionize, remarkHeadings],
},
vite: {
Expand All @@ -56,29 +55,24 @@ export default defineConfig({
],
},
integrations: [
svelte({
compilerOptions: {
cssHash: ({ hash, css }) => `s-${hash(css)}`,
discloseVersion: false,
},
}),
svelte(),
sitemap({
filter: page => !new RegExp(`^${site}/guide$`, 'u').test(page),
}),
mdx(),
],
prefetch: {
defaultStrategy: 'viewport',
prefetchAll: true,
},
build: {
inlineStylesheets: 'always',
format: 'file',
},
experimental: {
clientPrerender: true,
svgo: true,
},
publicDir: path.join(dirname, './docs/public'),
prefetch: {
defaultStrategy: 'hover',
},
server: {
port: 3000,
host: true,
Expand Down
5 changes: 4 additions & 1 deletion docs/components/CodeTabs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@
onMount(() => {
mounted = true
startKeyUX(globalThis, [focusGroupKeyUX()])
let stop = startKeyUX(globalThis, [focusGroupKeyUX()])
return () => {
stop()
}
})
</script>

Expand Down
9 changes: 8 additions & 1 deletion docs/components/Head.astro
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,14 @@ let isProduction = import.meta.env.PROD
localStorage.setItem('theme', theme)
}
initialize()
document.addEventListener('astro:after-swap', initialize)
let handlerKey = '__perfectionistThemeAfterSwap__'
if (!globalThis[handlerKey]) {
let handleAfterSwap = () => {
initialize()
}
document.addEventListener('astro:after-swap', handleAfterSwap)
globalThis[handlerKey] = handleAfterSwap
}
</script>

<ClientRouter />
Expand Down
90 changes: 67 additions & 23 deletions docs/components/Header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import SkipToContent from './SkipToContent.astro'
import Navigation from './Navigation.astro'
import IconMenu from '../icons/menu.svg'
import Search from './Search.svelte'
import Logo from './Logo.astro'

interface Props {
Expand All @@ -27,49 +28,92 @@ let { border = false } = Astro.props
<span class="title">Perfectionist</span>
</a>
</div>
<Search client:load />
<Navigation />
</header>

<script>
import { toggleMenu } from '../stores/menu-open'

let initMenu = () => {
document
.getElementById('menu-button')!
.addEventListener('click', toggleMenu)
let menuController: AbortController | undefined
let scrollController: AbortController | undefined

let cleanup = () => {
menuController?.abort()
scrollController?.abort()
menuController = undefined
scrollController = undefined
}

document.addEventListener('astro:after-swap', initMenu)
initMenu()
</script>
let setupMenu = () => {
let menuButton = document.getElementById('menu-button')
if (!menuButton) {
return
}

<script>
let initHeader = () => {
let header = document.querySelector('.header')!

document.addEventListener('scroll', () => {
let { scrollY } = globalThis

if (!header.classList.contains('border')) {
if (scrollY > 24) {
header.classList.add('scroll')
} else {
header.classList.remove('scroll')
}
menuController = new AbortController()
menuButton.addEventListener('click', toggleMenu, {
signal: menuController.signal,
})
}

let setupScroll = () => {
let header = document.querySelector('.header')
if (!header) {
return
}

let handleScroll = () => {
if (header.classList.contains('border')) {
return
}

header.classList.toggle('scroll', globalThis.scrollY > 24)
}

scrollController = new AbortController()
document.addEventListener('scroll', handleScroll, {
signal: scrollController.signal,
passive: true,
})
handleScroll()
}

let scheduleNext = () => {
document.addEventListener(
'astro:before-swap',
() => {
cleanup()
},
{ once: true },
)
document.addEventListener(
'astro:after-swap',
() => {
setup()
},
{ once: true },
)
}

let setup = () => {
cleanup()
setupMenu()
setupScroll()
scheduleNext()
}

document.addEventListener('astro:after-swap', initHeader)
initHeader()
setup()
</script>

<style>
.header {
position: sticky;
inset-block-start: 0;
z-index: 2;
display: flex;
display: grid;
grid-template-columns: auto auto 1fr;
gap: var(--space-m);
align-items: center;
justify-content: space-between;
block-size: var(--header-block-size);
Expand Down
Loading