This repository was archived by the owner on Jan 14, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
"use strict"/etc directives should be labeled as such #2
Comments
@JamesHenry Fix for this is easy, but its not supported by babel: case SyntaxKind.ExpressionStatement: {
Object.assign(result, {
type: AST_NODE_TYPES.ExpressionStatement,
expression: convertChild(node.expression)
});
if (
parent &&
(ts.isSourceFile(parent) ||
(ts.isBlock(parent) &&
parent.parent &&
(ts.isMethodDeclaration(parent.parent) ||
ts.isGetAccessorDeclaration(parent.parent) ||
ts.isSetAccessorDeclaration(parent.parent) ||
ts.isFunctionDeclaration(parent.parent) ||
ts.isConstructorDeclaration(parent.parent)))) &&
ts.isStringLiteral(node.expression) &&
(result.expression as any).type === AST_NODE_TYPES.Literal
) {
(result as any).directive = (result.expression as any).raw.slice(1, -1);
}
break;
} and i'm going to have to do disable alignment tests for:
|
@JamesHenry should we implement this and turn off alignment tests? |
@JamesHenry nvm i found out that babel is supporting this, but we was stripping directives from code. i will implement this today |
This was referenced Dec 25, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It is now been part of the ESTree spec for a while: eslint/typescript-eslint-parser#267
Prettier is currently having to work around this
The text was updated successfully, but these errors were encountered: