Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
textElements.map(element => {
const results = writeGood(element.text);
return results.map(result => {
return Promise.resolve(
createSuggestion({
id: uuid(),
description: result.reason,
context: element.text,
startIndex: result.index,
endIndex: result.index + result.offset,
element: element,
replacement: null,
color: "#ff0000",
})
);
});
})
);
[Syntax.Str](node) {
if (helper.isChildNode(node, [Syntax.BlockQuote])) {
return;
}
const text = getSource(node);
const suggestions = writeGood(text, options);
suggestions.forEach((suggestion) => {
const { index, reason: message } = suggestion;
report(node, new RuleError(message, { index }));
});
},
};