-
Notifications
You must be signed in to change notification settings - Fork 54
release v5.0.0 #569
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
azat-io
wants to merge
44
commits into
main
Choose a base branch
from
next
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+25,116
−21,698
Open
release v5.0.0 #569
Changes from 40 commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
eea30cd
feat!: drop nodejs v18 support
azat-io 7f24360
feat!: move to esm only
azat-io 3f840fc
chore: update dependencies
azat-io 50cbf85
chore: use esm-compatible dirname in vite config
azat-io 0d7c6c2
feat(sort-decorators): add array-based custom groups api
hugop95 7298b83
feat!: drop group kind support
hugop95 4988fce
feat(sort-heritage-clauses): add array-based custom groups api
hugop95 c174d95
chore: update dependencies
azat-io 377292d
feat(sort-imports)!: drop deprecated ts config root dir support
hugop95 a46deab
feat!: drop deprecated selectors support for multiple rules
hugop95 8834f41
feat!: drop deprecated object-based custom groups support
hugop95 20b6577
feat: support annotation-based config
hugop95 61cabe0
feat(sort-object-types)!: drop deprecated ignore pattern option
hugop95 9521e9f
feat(sort-jsx-props)!: drop deprecated ignore pattern option
hugop95 a2ffa76
feat: add sort-import-attributes rule
azat-io cab4d0f
feat: add sort-export-attributes rule
azat-io 1779615
chore: update dependencies
azat-io f312706
feat(sort-object)!: drop deprecated destructure only option
hugop95 ee31e2b
fix: fix plugin usage with legacy configurations
azat-io ae9817b
chore: update dependencies
azat-io cd117fa
feat(sort-objects): add pattern matching for variable declarations
hugop95 0c01411
chore: update dependencies
azat-io a01b8f3
fix: keep settings priority when meta default options provided
azat-io 576712c
chore: update eslint plugin
azat-io b0c8408
refactor: move typescript eslint types to dev dependencies
azat-io a5626e8
feat!: drop deprecated newlines between always and never
hugop95 65cd8ed
feat(sort-objects)!: migrate object type options to conditional confi…
hugop95 a65b39e
feat(sort-enums)!: replace force numeric sort and update default sort…
hugop95 0bc49f4
feat(sort-objects): add numeric keys detection option
hugop95 102a018
feat(sort-object-types): add numeric keys detection option
hugop95 e7d8f33
docs: fix memory leaks on website
azat-io f56267f
docs: add search
azat-io 03eb5de
docs: fix astro warnings
azat-io 5032f1d
chore: update dependencies
azat-io 590ce8e
feat(sort-imports): add multiline and singleline modifiers
hugop95 8f2126c
feat!: improve comment above integration in groups
hugop95 d0b38b9
fix: require sorting type in fallback sort schema
hugop95 513d13e
feat: allow type overrides in groups option
hugop95 98404bf
feat(sort-imports)!: drop deprecated selectors
hugop95 f9919cb
feat: allow order overrides in groups option
hugop95 885b3a8
feat: allow new lines inside overrides in groups option
hugop95 4977783
chore: update github actions
azat-io 4e03287
chore: update dependencies
azat-io 0403705
docs: enable svg optimization
azat-io File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| <script lang="ts"> | ||
| let { terms, text }: { terms: string[]; text: string } = $props() | ||
|
|
||
| interface Chunk { | ||
| highlight: boolean | ||
| value: string | ||
| } | ||
|
|
||
| let chunks = $derived(createChunks(text, terms)) | ||
|
|
||
| function createChunks(value: string, highlightTerms: string[]): Chunk[] { | ||
| if (!value) { | ||
| return [] | ||
| } | ||
|
|
||
| let uniqueTerms = [ | ||
| ...new Map( | ||
| highlightTerms.filter(Boolean).map(term => [term.toLowerCase(), term]), | ||
| ).values(), | ||
| ] | ||
|
|
||
| if (uniqueTerms.length === 0) { | ||
| return [{ highlight: false, value }] | ||
| } | ||
|
|
||
| uniqueTerms.sort((a, b) => b.length - a.length) | ||
|
|
||
| let escaped = uniqueTerms | ||
| .map(term => term.replaceAll(/[$()*+.?[\\\]^{|}]/gu, String.raw`\$&`)) | ||
| .join('|') | ||
|
|
||
| let pattern = new RegExp(`(${escaped})`, 'giu') | ||
| let result: Chunk[] = [] | ||
| let lastIndex = 0 | ||
|
|
||
| value.replace( | ||
| pattern, | ||
| (match: string, _group: string, offset: number): string => { | ||
| if (offset > lastIndex) { | ||
| result.push({ | ||
| value: value.slice(lastIndex, offset), | ||
| highlight: false, | ||
| }) | ||
| } | ||
|
|
||
| result.push({ | ||
| value: value.slice(offset, offset + match.length), | ||
| highlight: true, | ||
| }) | ||
|
|
||
| lastIndex = offset + match.length | ||
| return match | ||
| }, | ||
| ) | ||
|
|
||
| if (lastIndex < value.length) { | ||
| result.push({ | ||
| value: value.slice(lastIndex), | ||
| highlight: false, | ||
| }) | ||
| } | ||
|
|
||
| return result | ||
| } | ||
| </script> | ||
|
|
||
| {#each chunks as chunk, index (index)} | ||
| {#if chunk.highlight} | ||
| <mark data-index={index}>{chunk.value}</mark> | ||
| {:else} | ||
| {chunk.value} | ||
| {/if} | ||
| {/each} | ||
|
|
||
| <style> | ||
| mark { | ||
| padding-inline: 1px; | ||
| color: inherit; | ||
| background: var(--color-overlay-brand); | ||
| } | ||
| </style> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| <script lang="ts"> | ||
| function portal(node: HTMLElement): { | ||
| destroy(): void | ||
| } { | ||
| document.body.append(node) | ||
|
|
||
| return { | ||
| destroy() { | ||
| node.remove() | ||
| }, | ||
| } | ||
| } | ||
| </script> | ||
|
|
||
| <div use:portal> | ||
| <slot /> | ||
| </div> | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add SSR safety guard for document.body access.
Directly accessing
document.bodywill throw a ReferenceError during server-side rendering if this documentation site uses SSR (e.g., SvelteKit, Astro).Apply this diff to guard the portal initialization:
function portal(node: HTMLElement): { destroy(): void } { - document.body.append(node) + if (typeof document !== 'undefined') { + document.body.append(node) + } return { destroy() { - node.remove() + if (typeof document !== 'undefined') { + node.remove() + } }, } }📝 Committable suggestion
🤖 Prompt for AI Agents