You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/src/validate/js/utils/checkForAccessors.ts

15 lines
327 B

import { Validator } from '../../';
import { Node } from '../../../interfaces';
export default function checkForAccessors(
validator: Validator,
properties: Node[],
label: string
) {
properties.forEach(prop => {
if (prop.kind !== 'init') {
validator.error(`${label} cannot use getters and setters`, prop);
}
});
}