Skip to content

Instantly share code, notes, and snippets.

@utvk
utvk / gist:c1b22332fcbec037c357e2edcc1f3e42
Last active January 6, 2023 16:44
jscodeshift add type attribute to jsx buttons
module.exports = function(fi, api) {
var j = api.jscodeshift;
const hasNoTypeAttribute = function(path) {
return !path.value.openingElement.attributes.some(function(typePath) {
if (typePath.name.name !== 'type') {
return false;
}
return true;
});