run prettier (spaces -> tabs)

pull/1106/head
Rich Harris 7 years ago
parent 25a18ab495
commit cfdc8902ab

@ -21,7 +21,7 @@ export default function computed(validator: Validator, prop: Node) {
checkForDupes(validator, prop.value.properties);
checkForComputedKeys(validator, prop.value.properties);
checkForValidIdentifiers(validator, prop.value.properties);
checkForValidIdentifiers(validator, prop.value.properties);
prop.value.properties.forEach((computation: Node) => {
if (!isFunctionExpression.has(computation.value.type)) {

@ -8,14 +8,18 @@ export default function checkForValidIdentifiers(
properties: Node[]
) {
properties.forEach(prop => {
const name = getName(prop.key);
const functionDefinitionString = `function ${name}() {}`;
try {
parse(functionDefinitionString);
} catch(exception) {
const invalidCharacter = functionDefinitionString[exception.pos]
validator.error(`Computed property name "${name}" is invalid. Character '${invalidCharacter}' at position ${exception.pos} is illegal in function identifiers`, prop.start);
}
const name = getName(prop.key);
const functionDefinitionString = `function ${name}() {}`;
try {
parse(functionDefinitionString);
} catch (exception) {
const invalidCharacter = functionDefinitionString[exception.pos];
validator.error(
`Computed property name "${name}" is invalid. Character '${
invalidCharacter
}' at position ${exception.pos} is illegal in function identifiers`,
prop.start
);
}
});
}

@ -1,17 +1,17 @@
<p>
The hour is
<strong>{{hours}}</strong>
The hour is
<strong>{{hours}}</strong>
</p>
<script>
export default {
data() {
return {
time: new Date()
};
},
computed: {
"hours-hyphen": time => time.getHours()
}
};
export default {
data() {
return {
time: new Date()
};
},
computed: {
"hours-hyphen": time => time.getHours()
}
};
</script>

Loading…
Cancel
Save