stylelint-css-in-js-syntax
Version:
This plugin provides [ESLint](https://eslint.org/) rules that limit the line length of your comments. Furthermore, an **automatic fix** is included such that you can save time manually formatting your comments. As such it is recommended to apply this rule
13 lines (10 loc) • 678 B
JavaScript
import { restoreExpressions } from './util.restore-expressions.mjs';
function stringifier(root, builder) {
const restoredCss = restoreExpressions(root.toString()).replaceAll(/\/\*___start___\*\/.css\d+?{/g, "css`").replaceAll("}/*___end___*/", "`").replaceAll("/*__auto-close__*/;", "").replace(/\/\*refs (.*)\*\//, "").replaceAll(/\/\*___js___(.*?)___js-end___\n*\*\//gm, (replaceable) => {
const base64js = replaceable.replace(/^\/\*___js___/, "").replace(/___js-end___\n*\*\/$/gm, "");
return Buffer.from(base64js, "base64").toString("utf-8");
});
builder(restoredCss, root.nodes[0]);
}
export { stringifier };
//# sourceMappingURL=syntax.stringifier.mjs.map