1 | ;
|
2 |
|
3 | var utilContainsNewline = require('./util-contains-newline.js');
|
4 |
|
5 | function flowIndentCheck(indent, fc, onError) {
|
6 | if (fc?.type === 'flow-collection') {
|
7 | const end = fc.end[0];
|
8 | if (end.indent === indent &&
|
9 | (end.source === ']' || end.source === '}') &&
|
10 | utilContainsNewline.containsNewline(fc)) {
|
11 | const msg = 'Flow end indicator should be more indented than parent';
|
12 | onError(end, 'BAD_INDENT', msg, true);
|
13 | }
|
14 | }
|
15 | }
|
16 |
|
17 | exports.flowIndentCheck = flowIndentCheck;
|