@kcws/lintstaged-config
Version:
kamontat's lintstaged config
25 lines • 744 B
JavaScript
import { getCommand } from "../utils/cmd";
/**
* create command with input option
*
* @remarks
*
* Function type: {@link BaseActionFn} and
* Option type: {@link IPrettierOptions}
*
* @param option - customize option
* @returns command
*
* @beta
*/
export const prettier = (option) => {
var _a, _b;
const args = [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(" ");
};
//# sourceMappingURL=prettier.js.map