Merge pull request #793 from sveltejs/gh-791

error if component has transition
pull/799/head
Rich Harris 7 years ago committed by GitHub
commit 502f6b6d14

@ -116,6 +116,10 @@ export default function validateElement(validator: Validator, node: Node, refs:
} else if (attribute.type === 'EventHandler') {
validateEventHandler(validator, attribute, refCallees);
} else if (attribute.type === 'Transition') {
if (isComponent) {
validator.error(`Transitions can only be applied to DOM elements, not components`, attribute.start);
}
const bidi = attribute.intro && attribute.outro;
if (hasTransition) {

@ -0,0 +1,8 @@
[{
"message": "Transitions can only be applied to DOM elements, not components",
"loc": {
"line": 1,
"column": 8
},
"pos": 8
}]

@ -0,0 +1,15 @@
<Widget in:foo/>
<script>
import Widget from './Widget.html';
export default {
components: {
Widget
},
transitions: {
foo() {}
}
};
</script>
Loading…
Cancel
Save