Skip to content

Commit

Permalink
fix: small bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ota-meshi committed Mar 24, 2024
1 parent d55a51e commit fe6ffc6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
7 changes: 2 additions & 5 deletions src/rules/missing-client-only-directive-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ export default createRule("missing-client-only-directive-value", {
attr: AST.JSXAttribute | AST.AstroTemplateLiteralAttribute,
) {
const directiveName = getAttributeName(attr)
const directiveValue = getStaticAttributeValue(attr)

if (directiveName !== "client:only") return

if (directiveValue !== null) {
return
}
const directiveValue = getStaticAttributeValue(attr, context)
if (directiveValue !== null) return

context.report({
node: attr.name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import SomeSvelteComponent from "../SomeSvelteComponent.svelte"
let string = "svelte"
---

<!-- prettier-ignore-start -->
<SomeSvelteComponent client:only="svelte" />
<SomeSvelteComponent client:only={string} />
<SomeSvelteComponent client:idle />
<!-- prettier-ignore-end -->

0 comments on commit fe6ffc6

Please sign in to comment.