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

🐛 BUG: data-astro-reload should accept value #1006

Closed
stefanprobst opened this issue May 30, 2024 · 1 comment
Closed

🐛 BUG: data-astro-reload should accept value #1006

stefanprobst opened this issue May 30, 2024 · 1 comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)

Comments

@stefanprobst
Copy link

What version of @astrojs/compiler are you using?

2.8.0

What package manager are you using?

pnpm

What operating system are you using?

Linux

Describe the Bug

i want to be able to conditionally apply the data-astro-reload attribute, i.e. <a data-astro-reload={shouldReload || undefined}>, but i get a warning that "The data-astro-reload attribute does not accept a value".

import { parse } from '@astrojs/compiler';

const result = await parse('<a data-astro-reload={undefined} href="#">Click</a>')

console.log(result.diagnostics)
[
  {
    severity: 2,
    code: 2005,
    location: { file: '<stdin>', line: 1, column: 23, length: 9 },
    hint: '',
    text: 'The data-astro-reload attribute does not accept a value'
  }
]

the warning is surfaced via eslint-plugin-astro's valid-compile rule.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/stackblitz-starters-c53khs?file=index.js

@github-actions github-actions bot added the needs triage Issue needs to be triaged label May 30, 2024
@matthewp matthewp added - P2: nice to have Not breaking anything but nice to have (priority) and removed needs triage Issue needs to be triaged labels Jun 21, 2024
@matthewp
Copy link
Contributor

Closed by #1012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P2: nice to have Not breaking anything but nice to have (priority)
Projects
None yet
Development

No branches or pull requests

2 participants