UNPKG

@mui/codemod

Version:
22 lines (21 loc) 663 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = transformer; /** * @param {import('jscodeshift').FileInfo} file * @param {import('jscodeshift').API} api */ function transformer(file, api, options) { const j = api.jscodeshift; const printOptions = options.printOptions; return j(file.source).findJSXElements('Dialog').forEach(path => { const attributes = path.node.openingElement.attributes; attributes.forEach((node, index) => { if (node.type === 'JSXAttribute' && node.name.name === 'disableBackdropClick') { delete attributes[index]; } }); }).toSource(printOptions); }