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); checkForDupes(validator, prop.value.properties);
checkForComputedKeys(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) => { prop.value.properties.forEach((computation: Node) => {
if (!isFunctionExpression.has(computation.value.type)) { if (!isFunctionExpression.has(computation.value.type)) {

@ -8,14 +8,18 @@ export default function checkForValidIdentifiers(
properties: Node[] properties: Node[]
) { ) {
properties.forEach(prop => { properties.forEach(prop => {
const name = getName(prop.key); const name = getName(prop.key);
const functionDefinitionString = `function ${name}() {}`; const functionDefinitionString = `function ${name}() {}`;
try { try {
parse(functionDefinitionString); parse(functionDefinitionString);
} catch(exception) { } catch (exception) {
const invalidCharacter = functionDefinitionString[exception.pos] 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); 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> <p>
The hour is The hour is
<strong>{{hours}}</strong> <strong>{{hours}}</strong>
</p> </p>
<script> <script>
export default { export default {
data() { data() {
return { return {
time: new Date() time: new Date()
}; };
}, },
computed: { computed: {
"hours-hyphen": time => time.getHours() "hours-hyphen": time => time.getHours()
} }
}; };
</script> </script>

Loading…
Cancel
Save