Require '::a.b' to have a preceding ; in no-semi style (#1442)

This commit is contained in:
Kevin Gibbons authored and Christopher Chedeau committed 2017-04-27 14:00:04 -07:00
1 parent b2a092bd17
commit 10a5f68a12
6 files changed
+24 -14

No files matched your search

+1
View File
@@ -3556,6 +3556,7 @@ function exprNeedsASIProtection(node) {
node.type === "TemplateLiteral" ||
node.type === "TemplateElement" ||
node.type === "JSXElement" ||
node.type === "BindExpression" ||
node.type === "RegExpLiteral" ||
(node.type === "Literal" && node.pattern) ||
(node.type === "Literal" && node.regex);
@@ -0,0 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`no-semi.js 1`] = `
a
;::b.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a;
::b.c;
`;
exports[`no-semi.js 2`] = `
a
;::b.c
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a
;::b.c
`;
@@ -0,0 +1,2 @@
run_spec(__dirname, { parser: "babylon" });
run_spec(__dirname, { semi: false, parser: "babylon" });
@@ -0,0 +1,2 @@
a
;::b.c
@@ -103,8 +103,6 @@ x; (x, y) => x
class X {} [1, 2, 3].forEach(fn)
// TODO: enable lang features
// x; ::b.c
// TODO: upgrade parser
// class A {
// async; // The semicolon is *not* necessary
@@ -269,8 +267,6 @@ x;
class X {}
[1, 2, 3].forEach(fn);
// TODO: enable lang features
// x; ::b.c
// TODO: upgrade parser
// class A {
// async; // The semicolon is *not* necessary
@@ -424,8 +420,6 @@ x; (x, y) => x
class X {} [1, 2, 3].forEach(fn)
// TODO: enable lang features
// x; ::b.c
// TODO: upgrade parser
// class A {
// async; // The semicolon is *not* necessary
@@ -590,8 +584,6 @@ x
class X {}
;[1, 2, 3].forEach(fn)
// TODO: enable lang features
// x; ::b.c
// TODO: upgrade parser
// class A {
// async; // The semicolon is *not* necessary
@@ -745,8 +737,6 @@ x; (x, y) => x
class X {} [1, 2, 3].forEach(fn)
// TODO: enable lang features
// x; ::b.c
// TODO: upgrade parser
// class A {
// async; // The semicolon is *not* necessary
@@ -911,8 +901,6 @@ x
class X {}
;[1, 2, 3].forEach(fn)
// TODO: enable lang features
// x; ::b.c
// TODO: upgrade parser
// class A {
// async; // The semicolon is *not* necessary
-2
View File
@@ -19,8 +19,6 @@ x; (x, y) => x
class X {} [1, 2, 3].forEach(fn)
// TODO: enable lang features
// x; ::b.c
// TODO: upgrade parser
// class A {
// async; // The semicolon is *not* necessary