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

#6299 - Throw a compile error when passing an empty directive name #6300

Merged
merged 4 commits into from
Jun 28, 2021

Conversation

qurafi
Copy link
Contributor

@qurafi qurafi commented May 4, 2021

Fixes #6299.

Example of the error message:

<!-- ParseError: Action name cannot be empty -->
<element use: />

<!-- ParseError: Class name cannot be empty -->
<element class: />
<element class:="className" />
<element class:={class} />

<!-- ParseError: Transition name cannot be empty -->
<element in: />

src/compiler/parse/state/tag.ts Outdated Show resolved Hide resolved
@j3rem1e
Copy link

j3rem1e commented May 5, 2021

Does this break autocompletion in vscode when writing "class:" ?

@dummdidumm
Copy link
Member

Good point. Probably yes. In general it would be good to be able to pass a flag to the parser to be more forgiving, which the language-tools could use then.

@qurafi
Copy link
Contributor Author

qurafi commented May 5, 2021

Does this break autocompletion in vscode when writing "class:" ?

I tried it before and after the change. I didn't notice any issues or changes with autocomplete.

@dummdidumm
Copy link
Member

The VS Code extension uses a built-in version of Svelte do you can't test it that way. You would need to build from source.

@qurafi
Copy link
Contributor Author

qurafi commented May 5, 2021

I reload my vscode on every change and it seems it uses my local svelte version because of npm link

@tanhauhau tanhauhau merged commit 1b33248 into sveltejs:master Jun 28, 2021
@qurafi qurafi deleted the 6299 branch July 1, 2021 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No compile errors when passing empty directive names
4 participants