Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise((resolve, reject) => {
let MJMLDocument
const filePath = TextEditor.getPath();
const fileText = TextEditor.getText()
try {
MJMLDocument = documentParser(fileText)
} catch (e) {
reject(e)
}
const body = getMJBody(MJMLDocument)
if (!body || !body.children || body.children.length == 0) {
reject()
}
const report = MJMLValidator(body.children[0])
const formattedError = report.map(e => {
const line = e.line - 1
const currentLine = TextEditor.getBuffer().lineForRow(e.line - 1)
return {