main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
547 bytes
|
Rev | Line | |
---|
[d24f17c] | 1 | 'use strict';
|
---|
| 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;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.