import { getProjectRequire } from "@intlayer/config";

//#region ../@intlayer/cli/dist/esm/chokidar/dist/esm/writeContentDeclaration/detectFormatCommand.mjs
const detectFormatCommand = (configuration) => {
	const { formatCommand } = configuration.content;
	const projectRequire = getProjectRequire();
	if (formatCommand) return formatCommand;
	try {
		projectRequire.resolve("prettier");
		return "prettier --write \"{{file}}\" --log-level silent";
	} catch (_error) {}
	try {
		projectRequire.resolve("biome");
		return "biome format \"{{file}}\" --write --log-level none";
	} catch (_error) {}
	try {
		projectRequire.resolve("eslint");
		return "eslint --fix \"{{file}}\" --quiet";
	} catch (_error) {}
};

//#endregion
export { detectFormatCommand };
//# sourceMappingURL=detectFormatCommand.mjs.map