Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
visitCallExpression(path) {
if (types.ExpressionStatement.check(path.node)) {
path = path.get('expression');
}
if (path.node.type !== 'CallExpression') return false;
const module = utils.resolveToModule(path);
if (!module || !module.endsWith('createWithBsPrefix')) return false;
const [prefixNode, optionsNode] = path.node.arguments;
const comment = getComment(path);
let type = '"div"';
const property =
optionsNode &&
optionsNode.properties.find(p => p.key.name === 'Component');
if (property) {
type =
property.value.type === 'Identifier'
? property.value.name
: property.value.raw;
function isPropTypesExpression(path: string) {
const moduleName = utils.resolveToModule(path)
if (moduleName) {
return (
utils.isReactModuleName(moduleName) || moduleName === 'ReactPropTypes'
)
}
return false
}
function isPropTypesExpression(path) {
const moduleName = utils.resolveToModule(path);
if (moduleName) {
return (
utils.isReactModuleName(moduleName) || moduleName === "ReactPropTypes"
);
}
return false;
}