UNPKG

@sxzz/prettier-config

Version:
65 lines (62 loc) 1.44 kB
import { createRequire } from "node:module"; import process from "node:process"; import { fileURLToPath } from "node:url"; //#region rolldown:runtime var __require = /* @__PURE__ */ createRequire(import.meta.url); //#endregion //#region src/index.ts const resolveOpts = { paths: [process.cwd()] }; function isInstalled(pkg) { try { __require.resolve(pkg, resolveOpts); return true; } catch { return false; } } function resolvePlugin(pkg) { try { return fileURLToPath(import.meta.resolve(pkg)); } catch {} } const plugins = [fileURLToPath(import.meta.resolve("@prettier/plugin-oxc"))]; if (isInstalled("astro")) { const plugin = resolvePlugin("prettier-plugin-astro"); if (plugin) plugins.push(plugin); } var src_default = { semi: false, singleQuote: true, trailingComma: "all", overrides: [{ files: [ "**/node_modules/**", "**/dist/**", "**/coverage/**", "**/temp/**", "**/.vitepress/cache/**", "**/.nuxt/**", "**/.vercel/**", "**/.changeset/**", "**/.idea/**", "**/.output/**", "**/.vite-inspect/**", "output/**", "**/CHANGELOG*.md", "**/*.min.*", "**/LICENSE*", "**/__snapshots__", "**/auto-import?(s).d.ts", "**/components.d.ts", "**/typed-router.d.ts", "**/pnpm-lock.yaml" ], options: { requirePragma: true } }, { files: ["**/jsr.json"], options: { parser: "json-stringify" } }], plugins }; //#endregion export { src_default as default };