diff --git a/packages/babel-code-frame/src/index.js b/packages/babel-code-frame/src/index.js index 61b52e0d66..8fb318ec43 100644 --- a/packages/babel-code-frame/src/index.js +++ b/packages/babel-code-frame/src/index.js @@ -82,6 +82,13 @@ function getTokenType(match) { return "bracket"; } + if ( + token.type === "invalid" && + (token.value === "@" || token.value === "#") + ) { + return "punctuator"; + } + return token.type; }