Skip to content
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

chore: run the no-inspect rule only in Svelte 5’s runes mode #1018

Merged
merged 3 commits into from
Jan 14, 2025
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
5 changes: 5 additions & 0 deletions .changeset/smart-apes-confess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'eslint-plugin-svelte': patch
---

chore: run the `no-inspect` rule only in Svelte 5’s runes mode
8 changes: 7 additions & 1 deletion packages/eslint-plugin-svelte/src/rules/no-inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
docs: {
description: 'Warns against the use of `$inspect` directive',
category: 'Best Practices',
// TODO: Enable recommended in major version

Check warning on line 10 in packages/eslint-plugin-svelte/src/rules/no-inspect.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected 'todo' comment: 'TODO: Enable recommended in major...'
recommended: false,
default: 'warn'
},
Expand All @@ -15,7 +15,13 @@
messages: {
unexpected: 'Do not use $inspect directive'
},
type: 'suggestion'
type: 'suggestion',
conditions: [
{
svelteVersions: ['5'],
runes: [true, 'undetermined']
}
]
},
create(context) {
return {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"svelte": ">=5.0.0-0"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"svelte": ">=5.0.0-0"
}
Loading