15 lines
440 B
TypeScript
15 lines
440 B
TypeScript
|
|
import type { DataTreeEntity } from "entities/DataTree/dataTreeFactory";
|
||
|
|
import { isJSAction } from "@appsmith/workers/Evaluation/evaluationUtils";
|
||
|
|
|
||
|
|
// Removes "export default" statement from js Object
|
||
|
|
|
||
|
|
export function getJSToLint(
|
||
|
|
entity: DataTreeEntity,
|
||
|
|
snippet: string,
|
||
|
|
propertyPath: string,
|
||
|
|
): string {
|
||
|
|
return entity && isJSAction(entity) && propertyPath === "body"
|
||
|
|
? snippet.replace(/export default/g, "")
|
||
|
|
: snippet;
|
||
|
|
}
|