@bfra.me/prettier-config 0.9.1 → 0.9.4

Sign up to get free protection for your applications and to get access to all the features.
package/index.json ADDED
@@ -0,0 +1 @@
1
+ "prettier.config.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bfra.me/prettier-config",
3
- "version": "0.9.1",
3
+ "version": "0.9.4",
4
4
  "description": "Shared Prettier configuration for bfra.me",
5
5
  "keywords": [
6
6
  "bfra.me",
@@ -43,11 +43,12 @@
43
43
  "files": [
44
44
  "lib",
45
45
  "src",
46
+ "index.json",
46
47
  "prettier.config.js",
47
48
  "!**/*.map"
48
49
  ],
49
50
  "dependencies": {
50
- "@bfra.me/prettier-plugins": "0.5.1"
51
+ "@bfra.me/prettier-plugins": "0.5.2"
51
52
  },
52
53
  "devDependencies": {
53
54
  "@types/fs-extra": "11.0.4",
@@ -56,9 +57,9 @@
56
57
  "fs-extra": "11.2.0",
57
58
  "prettier": "3.3.3",
58
59
  "tsup": "8.3.5",
59
- "vitest": "2.1.4",
60
- "@bfra.me/prettier-config": "0.9.1",
61
- "@bfra.me/tsconfig": "0.9.0"
60
+ "vitest": "2.1.5",
61
+ "@bfra.me/prettier-config": "0.9.4",
62
+ "@bfra.me/tsconfig": "0.9.1"
62
63
  },
63
64
  "peerDependencies": {
64
65
  "prettier": "^3.0.0"
@@ -2,7 +2,7 @@ import {createRequire}from'node:module';import Io from'prettier';import {parsers
2
2
  `).length,s=e.length-t;return t>s?`\r
3
3
  `:`
4
4
  `}o(ts,"detectNewline");function be(r){return typeof r=="string"&&ts(r)||`
5
- `}o(be,"detectNewlineGraceful");var ns=new URL("./index.json",import.meta.url),is=JSON.parse(ss.readFileSync(ns)),je=is;function ue(r){if(typeof r!="object"||r===null)return !1;let e=Object.getPrototypeOf(r);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}o(ue,"isPlainObject");var oe=qe(At());var Ae=Object.hasOwn||((r,e)=>Object.prototype.hasOwnProperty.call(r,e)),x=o(r=>(e,...t)=>r.reduce((s,n)=>n(s,...t),e),"pipe"),B=o(r=>e=>Array.isArray(e)?r(e):e,"onArray"),Dt=o(r=>e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?r(e):e,"onStringArray"),H=Dt(r=>[...new Set(r)]),io=Dt(r=>[...r].sort()),ie=x([H,io]),D=o(r=>(e,...t)=>ue(e)?r(e,...t):e,"onObject"),v=o((r,e)=>{let t=D(s=>(e&&(s=Object.fromEntries(Object.entries(s).map(([n,i])=>[n,t(i)]))),(0, M.default)(s,r)));return t},"sortObjectBy"),R=v(),Se=v(["type","url"]),ke=v(["name","email","url"]),oo=v(["lib","bin","man","doc","example","test"]),A=o((r,e)=>(t,...s)=>Ae(t,r)?{...t,[r]:e(t[r],...s)}:t,"overProperty"),Tt=v(je),wt=o(r=>{let[e]=r.split(">"),t=[...e.matchAll("@")];if(!t.length||t.length===1&&t[0].index===0)return {name:r};let s=t.pop().index;return {name:e.substring(0,s),range:e.substring(s+1)}},"parseNameAndVersionRange"),ao=v((r,e)=>{let{name:t,range:s}=wt(r),{name:n,range:i}=wt(e);return t!==n?t.localeCompare(n):s?i?oe.default.compare(oe.default.minVersion(s),oe.default.minVersion(i)):1:-1}),qt=o(r=>{let e=r.split("@");return r.startsWith("@")?e.length>2?e.slice(0,-1).join("@"):r:e.length>1?e.slice(0,-1).join("@"):r},"getPackageName"),co=o((r,e)=>{let t=qt(r),s=qt(e);return t<s?-1:t>s?1:0},"sortObjectByIdent"),lo=["files","excludedFiles","env","parser","parserOptions","settings","plugins","extends","rules","overrides","globals","processor","noInlineConfig","reportUnusedDisableDirectives"],bt=D(x([v(lo),A("env",R),A("globals",R),A("overrides",B(r=>r.map(bt))),A("parserOptions",R),A("rules",v((r,e)=>r.split("/").length-e.split("/").length||r.localeCompare(e))),A("settings",R)])),uo=v(["description","url","href"]),po=D(x([r=>(0, M.default)(r,[...Object.keys(r).filter(e=>e!=="overrides").sort(),"overrides"]),A("overrides",B(r=>r.map(x([R,A("options",R)]))))])),fo=v(["node","npm","yarn"]),ho=["peerDependencyRules","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","allowedDeprecatedVersions","allowNonAppliedPatches","updateConfig","auditConfig","requiredScripts","supportedArchitectures","overrides","patchedDependencies","packageExtensions"],Eo=D(x([v(ho,!0),A("overrides",ao)])),mo=new Set(["install","pack","prepare","publish","restart","shrinkwrap","start","stop","test","uninstall","version"]),Pt=o((r,e)=>Ae(e,"devDependencies")&&Ae(e.devDependencies,r),"hasDevDependency"),Ct=D((r,e)=>{let t=Object.keys(r),s=new Set,n=t.map(a=>{let c=a.replace(/^(?:pre|post)/,"");return mo.has(c)||t.includes(c)?(s.add(c),c):a});!Pt("npm-run-all",e)&&!Pt("npm-run-all2",e)&&n.sort();let i=n.flatMap(a=>s.has(a)?[`pre${a}`,a,`post${a}`]:[a]);return (0, M.default)(r,i)}),jt=[{key:"$schema"},{key:"name"},{key:"displayName"},{key:"version"},{key:"private"},{key:"description"},{key:"categories",over:H},{key:"keywords",over:H},{key:"homepage"},{key:"bugs",over:v(["url","email"])},{key:"repository",over:Se},{key:"funding",over:Se},{key:"license",over:Se},{key:"qna"},{key:"author",over:ke},{key:"maintainers",over:B(r=>r.map(ke))},{key:"contributors",over:B(r=>r.map(ke))},{key:"publisher"},{key:"sideEffects"},{key:"type"},{key:"imports"},{key:"exports"},{key:"main"},{key:"svelte"},{key:"umd:main"},{key:"jsdelivr"},{key:"unpkg"},{key:"module"},{key:"source"},{key:"jsnext:main"},{key:"browser"},{key:"react-native"},{key:"types"},{key:"typesVersions"},{key:"typings"},{key:"style"},{key:"example"},{key:"examplestyle"},{key:"assets"},{key:"bin",over:R},{key:"man"},{key:"directories",over:oo},{key:"files",over:H},{key:"workspaces"},{key:"binary",over:v(["module_name","module_path","remote_path","package_name","host"])},{key:"scripts",over:Ct},{key:"betterScripts",over:Ct},{key:"contributes",over:R},{key:"activationEvents",over:H},{key:"husky",over:A("hooks",Tt)},{key:"simple-git-hooks",over:Tt},{key:"pre-commit"},{key:"commitlint",over:R},{key:"lint-staged"},{key:"nano-staged"},{key:"config",over:R},{key:"nodemonConfig",over:R},{key:"browserify",over:R},{key:"babel",over:R},{key:"browserslist"},{key:"xo",over:R},{key:"prettier",over:po},{key:"eslintConfig",over:bt},{key:"eslintIgnore"},{key:"npmpkgjsonlint",over:R},{key:"npmPackageJsonLintConfig",over:R},{key:"npmpackagejsonlint",over:R},{key:"release",over:R},{key:"remarkConfig",over:R},{key:"stylelint"},{key:"ava",over:R},{key:"jest",over:R},{key:"jest-junit",over:R},{key:"jest-stare",over:R},{key:"mocha",over:R},{key:"nyc",over:R},{key:"c8",over:R},{key:"tap",over:R},{key:"oclif",over:v(void 0,!0)},{key:"resolutions",over:R},{key:"dependencies",over:R},{key:"devDependencies",over:R},{key:"dependenciesMeta",over:v(co,!0)},{key:"peerDependencies",over:R},{key:"peerDependenciesMeta",over:v(void 0,!0)},{key:"optionalDependencies",over:R},{key:"bundledDependencies",over:ie},{key:"bundleDependencies",over:ie},{key:"extensionPack",over:ie},{key:"extensionDependencies",over:ie},{key:"flat"},{key:"packageManager"},{key:"engines",over:R},{key:"engineStrict",over:R},{key:"volta",over:fo},{key:"languageName"},{key:"os"},{key:"cpu"},{key:"preferGlobal",over:R},{key:"publishConfig",over:R},{key:"icon"},{key:"badges",over:B(r=>r.map(uo))},{key:"galleryBanner",over:R},{key:"preview"},{key:"markdown"},{key:"pnpm",over:Eo}],xt=jt.map(({key:r})=>r),yo=x(jt.map(({key:r,over:e})=>e?A(r,e):void 0).filter(Boolean));function Ro(r,e){if(typeof r=="string"){let{indent:t,type:s}=le(r),n=r.slice(-1)===`
5
+ `}o(be,"detectNewlineGraceful");var ns=new URL("./index.json",import.meta.url),is=JSON.parse(ss.readFileSync(ns)),je=is;function ue(r){if(typeof r!="object"||r===null)return !1;let e=Object.getPrototypeOf(r);return (e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)}o(ue,"isPlainObject");var oe=qe(At());var Ae=Object.hasOwn||((r,e)=>Object.prototype.hasOwnProperty.call(r,e)),x=o(r=>(e,...t)=>r.reduce((s,n)=>n(s,...t),e),"pipe"),B=o(r=>e=>Array.isArray(e)?r(e):e,"onArray"),Dt=o(r=>e=>Array.isArray(e)&&e.every(t=>typeof t=="string")?r(e):e,"onStringArray"),H=Dt(r=>[...new Set(r)]),io=Dt(r=>[...r].sort()),ie=x([H,io]),D=o(r=>(e,...t)=>ue(e)?r(e,...t):e,"onObject"),v=o((r,e)=>{let t=D(s=>(e&&(s=Object.fromEntries(Object.entries(s).map(([n,i])=>[n,t(i)]))),(0, M.default)(s,r)));return t},"sortObjectBy"),R=v(),Se=v(["type","url"]),ke=v(["name","email","url"]),oo=v(["lib","bin","man","doc","example","test"]),A=o((r,e)=>(t,...s)=>Ae(t,r)?{...t,[r]:e(t[r],...s)}:t,"overProperty"),Tt=v(je),wt=o(r=>{let[e]=r.split(">"),t=[...e.matchAll("@")];if(!t.length||t.length===1&&t[0].index===0)return {name:r};let s=t.pop().index;return {name:e.substring(0,s),range:e.substring(s+1)}},"parseNameAndVersionRange"),ao=v((r,e)=>{let{name:t,range:s}=wt(r),{name:n,range:i}=wt(e);return t!==n?t.localeCompare(n,"en"):s?i?oe.default.compare(oe.default.minVersion(s),oe.default.minVersion(i)):1:-1}),qt=o(r=>{let e=r.split("@");return r.startsWith("@")?e.length>2?e.slice(0,-1).join("@"):r:e.length>1?e.slice(0,-1).join("@"):r},"getPackageName"),co=o((r,e)=>{let t=qt(r),s=qt(e);return t<s?-1:t>s?1:0},"sortObjectByIdent"),lo=["files","excludedFiles","env","parser","parserOptions","settings","plugins","extends","rules","overrides","globals","processor","noInlineConfig","reportUnusedDisableDirectives"],bt=D(x([v(lo),A("env",R),A("globals",R),A("overrides",B(r=>r.map(bt))),A("parserOptions",R),A("rules",v((r,e)=>r.split("/").length-e.split("/").length||r.localeCompare(e))),A("settings",R)])),uo=v(["description","url","href"]),po=D(x([r=>(0, M.default)(r,[...Object.keys(r).filter(e=>e!=="overrides").sort(),"overrides"]),A("overrides",B(r=>r.map(x([R,A("options",R)]))))])),fo=v(["node","npm","yarn"]),ho=["peerDependencyRules","neverBuiltDependencies","onlyBuiltDependencies","onlyBuiltDependenciesFile","allowedDeprecatedVersions","allowNonAppliedPatches","updateConfig","auditConfig","requiredScripts","supportedArchitectures","overrides","patchedDependencies","packageExtensions"],Eo=D(x([v(ho,!0),A("overrides",ao)])),mo=new Set(["install","pack","prepare","publish","restart","shrinkwrap","start","stop","test","uninstall","version"]),Pt=o((r,e)=>Ae(e,"devDependencies")&&Ae(e.devDependencies,r),"hasDevDependency"),Ct=D((r,e)=>{let t=Object.keys(r),s=new Set,n=t.map(a=>{let c=a.replace(/^(?:pre|post)/,"");return mo.has(c)||t.includes(c)?(s.add(c),c):a});!Pt("npm-run-all",e)&&!Pt("npm-run-all2",e)&&n.sort();let i=n.flatMap(a=>s.has(a)?[`pre${a}`,a,`post${a}`]:[a]);return (0, M.default)(r,i)}),jt=[{key:"$schema"},{key:"name"},{key:"displayName"},{key:"version"},{key:"private"},{key:"description"},{key:"categories",over:H},{key:"keywords",over:H},{key:"homepage"},{key:"bugs",over:v(["url","email"])},{key:"repository",over:Se},{key:"funding",over:Se},{key:"license",over:Se},{key:"qna"},{key:"author",over:ke},{key:"maintainers",over:B(r=>r.map(ke))},{key:"contributors",over:B(r=>r.map(ke))},{key:"publisher"},{key:"sideEffects"},{key:"type"},{key:"imports"},{key:"exports"},{key:"main"},{key:"svelte"},{key:"umd:main"},{key:"jsdelivr"},{key:"unpkg"},{key:"module"},{key:"source"},{key:"jsnext:main"},{key:"browser"},{key:"react-native"},{key:"types"},{key:"typesVersions"},{key:"typings"},{key:"style"},{key:"example"},{key:"examplestyle"},{key:"assets"},{key:"bin",over:R},{key:"man"},{key:"directories",over:oo},{key:"files",over:H},{key:"workspaces"},{key:"binary",over:v(["module_name","module_path","remote_path","package_name","host"])},{key:"scripts",over:Ct},{key:"betterScripts",over:Ct},{key:"contributes",over:R},{key:"activationEvents",over:H},{key:"husky",over:A("hooks",Tt)},{key:"simple-git-hooks",over:Tt},{key:"pre-commit"},{key:"commitlint",over:R},{key:"lint-staged"},{key:"nano-staged"},{key:"config",over:R},{key:"nodemonConfig",over:R},{key:"browserify",over:R},{key:"babel",over:R},{key:"browserslist"},{key:"xo",over:R},{key:"prettier",over:po},{key:"eslintConfig",over:bt},{key:"eslintIgnore"},{key:"npmpkgjsonlint",over:R},{key:"npmPackageJsonLintConfig",over:R},{key:"npmpackagejsonlint",over:R},{key:"release",over:R},{key:"remarkConfig",over:R},{key:"stylelint"},{key:"ava",over:R},{key:"jest",over:R},{key:"jest-junit",over:R},{key:"jest-stare",over:R},{key:"mocha",over:R},{key:"nyc",over:R},{key:"c8",over:R},{key:"tap",over:R},{key:"oclif",over:v(void 0,!0)},{key:"resolutions",over:R},{key:"dependencies",over:R},{key:"devDependencies",over:R},{key:"dependenciesMeta",over:v(co,!0)},{key:"peerDependencies",over:R},{key:"peerDependenciesMeta",over:v(void 0,!0)},{key:"optionalDependencies",over:R},{key:"bundledDependencies",over:ie},{key:"bundleDependencies",over:ie},{key:"extensionPack",over:ie},{key:"extensionDependencies",over:ie},{key:"flat"},{key:"packageManager"},{key:"engines",over:R},{key:"engineStrict",over:R},{key:"volta",over:fo},{key:"languageName"},{key:"os"},{key:"cpu"},{key:"preferGlobal",over:R},{key:"publishConfig",over:R},{key:"icon"},{key:"badges",over:B(r=>r.map(uo))},{key:"galleryBanner",over:R},{key:"preview"},{key:"markdown"},{key:"pnpm",over:Eo}],xt=jt.map(({key:r})=>r),yo=x(jt.map(({key:r,over:e})=>e?A(r,e):void 0).filter(Boolean));function Ro(r,e){if(typeof r=="string"){let{indent:t,type:s}=le(r),n=r.slice(-1)===`
6
6
  `?`
7
7
  `:"",i=be(r);r=JSON.parse(r);let a=JSON.stringify(e(r),null,s==="tab"?" ":t)+n;return i===`\r
8
8
  `&&(a=a.replace(/\n/g,i)),a}return e(r)}o(Ro,"editStringJSON");var $o=o(r=>r[0]==="_","isPrivateKey"),go=o((r,e)=>r.reduce((t,s)=>(t[e(s)?0:1].push(s),t),[[],[]]),"partition");function Gt(r,e={}){return Ro(r,D(t=>{let s=e.sortOrder||xt;if(Array.isArray(s)){let n=Object.keys(t),[i,a]=go(n,$o);s=[...s,...xt,...a.sort(),...i.sort()];}return yo((0, M.default)(t,s),t)}))}o(Gt,"sortPackageJson");var Ft={sortPackageJsonSortOrder:{category:"Format",type:"string",description:"Custom ordering array.",default:[{value:[]}],array:!0}},{languages:No}=Oo,Ut=No.filter(({name:r})=>r==="JSON.stringify"),ae=parsers["json-stringify"],Vt={"json-stringify":{...ae,async parse(r,e){let{filepath:t}=e;if(/package.*json$/u.test(t)){r=await Io.format(r,{filepath:t}),ae.preprocess&&(r=ae.preprocess(r,e));let s=e?.sortPackageJsonSortOrder;r=Gt(r,s&&s.length>0?{sortOrder:s}:{});}return ae.parse(r,e)}}},Xt={languages:Ut,options:Ft,parsers:Vt},Lo=Xt;var we={"@bfra.me/prettier-plugins/package-json":Te};async function _t(r,e){try{if(!we[e]){let t=r(e);we[e]=t;}return we[e]??e}catch{return e}}o(_t,"resolve");var ko=createRequire(import.meta.url),Ao=_t.bind(null,ko.resolve),{searchParams:To}=new URL(import.meta.url),wo={arrowParens:"avoid",bracketSpacing:!1,endOfLine:"auto",printWidth:100,semi:To.has("semi","true"),singleQuote:!0,overrides:[{files:["**/node_modules/**","**/dist/**","**/coverage/**","**/out/**","**/temp/**","**/.idea/**","**/.next/**","**/.nuxt/**","**/.output/**","**/.tsup/**","**/.vercel/**","**/.vitepress/cache/**","**/.vite-inspect/**","**/__snapshots__/**","**/test/fixtures/**","**/auto-import?(s).d.ts","**/.changeset/*.md","**/CHANGELOG*.md","**/changelog*.md","**/components.d.ts","**/devcontainer-lock.json","**/LICENSE*","**/license*","**/*.min.*","**/package-lock.json","**/pnpm-lock.yaml","**/typed-router.d.ts","**/yarn.lock"],options:{requirePragma:!0}},{files:[".vscode/*.json",".devcontainer/**/devcontainer*.json"],options:{tabWidth:4}},{files:["*.md"],options:{proseWrap:"never",singleQuote:!1}}],plugins:["@bfra.me/prettier-plugins/package-json"].map(Ao)},Cc=wo;export{Cc as default};//# sourceMappingURL=prettier.config.js.map