Do not accept declare on previous line (#2618)

This commit is contained in:
Lucas Azzola authored and GitHub committed 2017-08-13 13:47:48 +10:00
1 parent dbe0ca6c26
commit ec85cf0f0a
3 files changed
+23 -1

No files matched your search

+3 -1
View File
@@ -4676,7 +4676,9 @@ function isNodeStartingWithDeclare(node, options) {
return false;
}
return (
options.originalText.slice(0, util.locStart(node)).match(/declare\s*$/) ||
options.originalText
.slice(0, util.locStart(node))
.match(/declare[ \t]*$/) ||
options.originalText
.slice(node.range[0], node.range[1])
.startsWith("declare ")