eslint-plugin-better-tailwindcss
Version:
auto-wraps tailwind classes after a certain print width or class count into multiple lines to improve readability.
20 lines • 871 B
JavaScript
// runner.js
import { resolve } from "node:path";
import { createSyncFn } from "synckit";
import { getTailwindcssVersion } from "../async-utils/tailwindcss.js";
import { getWorkerOptions } from "../async-utils/worker.js";
export function createGetConflictingClasses() {
const workerPath = getWorkerPath();
const workerOptions = getWorkerOptions();
return createSyncFn(workerPath, workerOptions);
}
function getWorkerPath() {
const { major } = getTailwindcssVersion();
return resolve(getCurrentDirectory(), `./conflicting-classes.async.worker.v${major}.js`);
}
function getCurrentDirectory() {
// eslint-disable-next-line eslint-plugin-typescript/prefer-ts-expect-error
// @ts-ignore - `import.meta` doesn't exist in CommonJS -> will be transformed in build step
return import.meta.dirname;
}
//# sourceMappingURL=conflicting-classes.js.map