From d703e6cd64af09406843e21771e97ea9cc006475 Mon Sep 17 00:00:00 2001 From: Thomas Schlage Date: Mon, 5 Feb 2018 15:13:05 +0100 Subject: [PATCH] Fix unrecognized super class if wrapped in parenthesis --- src/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.js b/src/index.js index 5e34095..b8c05ad 100644 --- a/src/index.js +++ b/src/index.js @@ -71,6 +71,11 @@ export default function({types: t}){ // Ensure the class is extending something. const superClass = path.get('superClass'); if (!superClass.node) return; + + // Other plugins might wrap the super class in parenthesis + if (superClass.type === 'ParenthesizedExpression') { + superClass = superClass.get('expression'); + } // Ensure that the class is extending a variable matching one of the options. const matches = classes.some(name => superClass.isIdentifier({name}));