Handle flow comments with leading spaces (#9168)

* check for spaces and tabs before a flow comment

* fix issue with using string index and shift interchangably

* update tests

* Use update charcodes version

* Disallow flow-comments in flow-comments and check for unterminated comments
This commit is contained in:
Vikram Rangaraj
2018-12-13 22:10:01 -08:00
committed by Daniel Tschinder
parent b9340bc597
commit 72471aff63
25 changed files with 404 additions and 133 deletions

View File

@@ -27,7 +27,6 @@ decorators/migrated_0007.js
private_class_properties/multiple.js
private_class_properties/super.js
types/annotations/migrated_0001.js
types/annotations_in_comments_invalid/migrated_0003.js
types/annotations/void_is_reserved_param.js
types/member/reserved_words.js
types/parameter_defaults/migrated_0032.js
@@ -38,3 +37,4 @@ numbers/underscored_float_whole.js
numbers/underscored_hex.js
numbers/underscored_number.js
numbers/underscored_oct.js
types/annotations_in_comments/migrated_0001.js

View File

@@ -98,7 +98,7 @@ function update_whitelist(summary) {
);
});
const newLines = disallowed
const newLines = summary.disallowed.failure
.map(({ test }) => test.file)
.filter(test => oldLines.indexOf(test) === -1);