Skip to content

Commit

Permalink
chore: add an image sizing codemod to remove block level image sizing…
Browse files Browse the repository at this point in the history
… elements
  • Loading branch information
jerelmiller committed Feb 10, 2021
1 parent 15b4808 commit a278d05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions codemods/imageSizing.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const visit = require('unist-util-visit');
const { isMdxBlockElement } = require('./utils/mdxast');

const imageSizing = () => (tree) => {
visit(tree, isMdxBlockElement('ImageSizing'), (node, idx, parent) => {
parent.children[idx] = node.children[0];
});
};

module.exports = imageSizing;
1 change: 1 addition & 0 deletions codemods/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,5 @@ module.exports = [
watermarks,
landingPageHero,
techTiles,
require('./imageSizing'),
];

0 comments on commit a278d05

Please sign in to comment.