const isDisplayStaticAndConditionalSwitcher = (fieldNode, window) => {
const fieldDataSourceCode = fieldNode.getAttribute('DataSourceCode') || [];
const nodeValues = Object.values(window?.Designer?.nodes); // get the nodes values
const formDataSourceCode = nodeValues.map((o) => {
if (o.displayName === 'Form') { return o.props.code; }
}).filter((v) => v)[0];
return fieldDataSourceCode === formDataSourceCode;
};
I am getting the error, expected to return a value at the end of the arrow function error
How should I resolve the issue?
Your lint rules want you to explicitly return undefined:
nodeValues.map((o) => {
if (o.displayName === "Form") {
return o.props.code;
} else {
return undefined;
}
});