Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let message = buildErrorMessage(options.moduleId, error);
messages.push(message);
}
let rules = this.buildRules({
results: messages,
pending: pendingStatus,
moduleId: options.moduleId,
moduleName: options.moduleId,
configResolver: options.configResolver,
rawSource: source,
});
for (let rule of rules) {
try {
transform(templateAST, () => rule.getVisitor());
} catch (error) {
let message = buildErrorMessage(options.moduleId, error);
messages.push(message);
}
}
if (pendingStatus) {
if (messages.length === 0) {
messages.push({
rule: 'invalid-pending-module',
message: `Pending module (\`${options.moduleId}\`) passes all rules. Please remove \`${options.moduleId}\` from pending list.`,
moduleId: options.moduleId,
severity: 2,
});
} else {
if (pendingStatus.only) {
module.exports = function transform(fileInfo, config, invokableData = {}) {
config = config || {};
config.helpers = config.helpers || [];
config.skipBuiltInComponents =
'skipBuiltInComponents' in config ? config.skipBuiltInComponents : false;
config.skipFilesThatMatchRegex = config.skipFilesThatMatchRegex || null;
if (shouldSkipFile(fileInfo, config)) {
return fileInfo.source;
}
let { code: toAngleBracket } = recast.transform(fileInfo.source, () =>
transformToAngleBracket(fileInfo, config, invokableData)
);
let attrEqualEmptyString = new RegExp(_EMPTY_STRING_, 'gi');
let dataEqualsNoValue = /(data-\S+)=""/gim;
toAngleBracket = toAngleBracket.replace(attrEqualEmptyString, '');
toAngleBracket = toAngleBracket.replace(dataEqualsNoValue, '$1');
return toAngleBracket;
};