Skip to content

web: codemod template literal to `classNames` call [2]

Warren Gifford requested to merge vb/template-literal-to-classnames-2 into main

Created by: valerybugakov

Context

To improve consistency of class names creation in React components and avoid processing template literal cases in the global-css-to-css-modules codemod another codemod was added to automatically transform template literals to classNames() utility calls:

<div className={`cool-class ${props.className || ''}`} />
// turns into 
<div className={classNames('cool-class', props.className)} />

This PR applies a newly added codemod to the part of the codebase.

Changes

  • Converted template literals usage in className prop to classNames() utility call.

Merge request reports

Loading