-
-
Notifications
You must be signed in to change notification settings - Fork 58
feat(no-navigation-without-resolve): checking link shorthand attributes #1323
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
base: main
Are you sure you want to change the base?
feat(no-navigation-without-resolve): checking link shorthand attributes #1323
Conversation
🦋 Changeset detectedLatest commit: 70a5aac The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Try the Instant Preview in Online PlaygroundInstall the Instant Preview to Your Local
Published Instant Preview Packages:
|
232b605
to
7222885
Compare
This one is now ready :) |
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.
Why does it only check href? Shouldn’t the following patterns also be checked?
<script>
const validLink = resolve("/foo");
const invalidLink = "/foo";
</script>
<a href={validLink}>Click me!</a>
<a href={invalidLink}>Click me!</a>
Those are already checked without this PR :) This one just adds support for the shorthand... |
7222885
to
70a5aac
Compare
}, | ||
SvelteShorthandAttribute(node) { | ||
if ( | ||
context.options[0]?.ignoreLinks === true || |
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.
Could you extract this outside of the return {...}
and store it in a variable?
This will prevent us from having to modify the default option in multiple places in the future and forgetting to do so.
Fixes the issue mentioned in #1319 (comment)
But this is too interconnected with #1322, @ota-meshi can we get that one merged first please and I will then rebase this one :)