ohctechv3/.svn/pristine/70/707f40dc83293f43badfecf3b749b265636ee32f.svn-base

16 lines
494 B
Plaintext
Raw Normal View History

2024-10-28 15:03:36 +05:30
import { containsNewline } from './util-contains-newline.js';
function flowIndentCheck(indent, fc, onError) {
if (fc?.type === 'flow-collection') {
const end = fc.end[0];
if (end.indent === indent &&
(end.source === ']' || end.source === '}') &&
containsNewline(fc)) {
const msg = 'Flow end indicator should be more indented than parent';
onError(end, 'BAD_INDENT', msg, true);
}
}
}
export { flowIndentCheck };