UNPKG

@intlayer/chokidar

Version:

Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.

33 lines (31 loc) 1.32 kB
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_runtime = require('./_virtual/_rolldown/runtime.cjs'); let _intlayer_config_utils = require("@intlayer/config/utils"); //#region src/detectFormatCommand.ts let cachedFormatCommand = null; const detectFormatCommand = (configuration, projectRequireProp) => { const { baseDir } = configuration.system; const { formatCommand } = configuration.content; const projectRequire = projectRequireProp ?? (0, _intlayer_config_utils.getProjectRequire)(baseDir); if (formatCommand) return formatCommand; if (cachedFormatCommand !== null) return cachedFormatCommand; try { projectRequire.resolve("prettier"); cachedFormatCommand = "prettier --write \"{{file}}\" --log-level silent"; return cachedFormatCommand; } catch (_error) {} try { projectRequire.resolve("biome"); cachedFormatCommand = "biome format \"{{file}}\" --write --log-level none"; return cachedFormatCommand; } catch (_error) {} try { projectRequire.resolve("eslint"); cachedFormatCommand = "eslint --fix \"{{file}}\" --quiet || node -e \"process.exit(0)\""; return cachedFormatCommand; } catch (_error) {} cachedFormatCommand = void 0; }; //#endregion exports.detectFormatCommand = detectFormatCommand; //# sourceMappingURL=detectFormatCommand.cjs.map