merge validation transformers
This commit is contained in:
parent
119314df74
commit
35c49dbef7
@ -1,9 +1,8 @@
|
||||
export default {
|
||||
strict: require("./other/strict"),
|
||||
|
||||
"validation.undeclaredVariableCheck": require("./validation/undeclared-variable-check"),
|
||||
"validation.noForInOfAssignment": require("./validation/no-for-in-of-assignment"),
|
||||
"validation.setters": require("./validation/setters"),
|
||||
_validation: require("./internal/validation"),
|
||||
|
||||
"validation.react": require("./validation/react"),
|
||||
|
||||
// this goes at the start so we only transform the original user code
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import * as messages from "../../../messages";
|
||||
import t from "../../../types";
|
||||
|
||||
export { isFor as check } from "../../../types";
|
||||
|
||||
export function ForOfStatement(node, parent, scope, file) {
|
||||
var left = node.left;
|
||||
if (t.isVariableDeclaration(left)) {
|
||||
@ -12,3 +10,11 @@ export function ForOfStatement(node, parent, scope, file) {
|
||||
}
|
||||
|
||||
export { ForOfStatement as ForInStatement };
|
||||
|
||||
export function Property(node, parent, scope, file) {
|
||||
if (node.kind === "set" && node.value.params.length !== 1) {
|
||||
throw file.errorWithNode(node.value, messages.get("settersInvalidParamLength"));
|
||||
}
|
||||
}
|
||||
|
||||
export { Property as MethodDefinition };
|
||||
@ -1,13 +0,0 @@
|
||||
import * as messages from "../../../messages";
|
||||
|
||||
export function check(node) {
|
||||
return node.kind === "set";
|
||||
}
|
||||
|
||||
export function Property(node, parent, scope, file) {
|
||||
if (node.kind === "set" && node.value.params.length !== 1) {
|
||||
throw file.errorWithNode(node.value, messages.get("settersInvalidParamLength"));
|
||||
}
|
||||
}
|
||||
|
||||
export { Property as MethodDefinition };
|
||||
Loading…
x
Reference in New Issue
Block a user