UNPKG

@kcws/lintstaged-config

Version:
29 lines 877 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.prettier = void 0; const cmd_1 = require("../utils/cmd"); /** * create command with input option * * @remarks * * Function type: {@link BaseActionFn} and * Option type: {@link IPrettierOptions} * * @param option - customize option * @returns command * * @beta */ const prettier = (option) => { var _a, _b; const args = [(0, cmd_1.getCommand)("prettier")]; if ((_a = option === null || option === void 0 ? void 0 : option.fix) !== null && _a !== void 0 ? _a : true) args.push("--write"); const files = (_b = option === null || option === void 0 ? void 0 : option.files) !== null && _b !== void 0 ? _b : []; if (files.length > 0) args.push(...files); return args.join(" "); }; exports.prettier = prettier; //# sourceMappingURL=prettier.js.map