JS: recognize transform-react-jsx plugin#373
Conversation
xiemaisi
left a comment
There was a problem hiding this comment.
Basically LGTM; happy to see that it's easy to support!
| /** | ||
| * Gets a file affected by this Babel configuration. | ||
| */ | ||
| Container getAContainerInScope() { |
There was a problem hiding this comment.
We already have an appliesTo predicate in a subclass of Config; maybe we should just PUT that predicate here and improve it?
There was a problem hiding this comment.
Hadn't noticed that, though it doesn't appear in a subclass, it appears in the other plugin class.
I've introduced a Plugin class to factor out some common logic in the two plugin classes. We now also have appliesTo on both Config and Plugin.
The getAContainerInScope() has to be there in some form or other, since the recursion steps through folders, which aren't top-levels. We can rename it if you like. I'd like to keep it public, though, so we can easily tweak it at customers.
| } | ||
|
|
||
| /** Gets the name of the variable used to create JSX elements. */ | ||
| string getJSXFactoryVariableName() { |
There was a problem hiding this comment.
Perhaps change JSX to Jsx for consistency with the class name (and our normal camel-case conventions).
| this = cfg.getPluginConfig(pluginName) | ||
| } | ||
|
|
||
| /** Gets the name of the plugin begin installed. */ |
Ruby: warn that Ruby is still in Beta
Fix expected test file
Fixes a false positive in UnusedVariable.ql due to imports that are used by JSX, for example:
becomes
This was already supported in some cases, but not when the name of the JSX factory came from the
transform-react-jsxplugin configuration in a.babelrcfile.