UNPKG

prettylint

Version:
15 lines (14 loc) 522 B
// modified from https://github.com/prettier/prettier/blob/3.0.0/src/cli/options/get-options-for-file.js import { resolveConfig } from "prettier"; async function getOptionsOrDie(context, filePath) { if (context.argv.config === false) { return null; } return await resolveConfig(filePath, { editorconfig: context.argv.editorconfig, config: context.argv.config, }); } export async function getOptionsForFile(context, filepath) { return await getOptionsOrDie(context, filepath); }