@szum-tech/prettier-config
Version:
Prettier shareable configuration.
2 lines • 1.69 kB
JavaScript
;var fs=require('fs'),path=require('path');var e=console;function d(n){let s=process.cwd(),a=h(s);try{let t=fs.readFileSync(a??"","utf-8"),o=JSON.parse(t),i=o.dependencies||{},c=o.devDependencies||{};return i.hasOwnProperty(n)||c.hasOwnProperty(n)}catch(t){e.error("Error reading package.json file:",t),process.exit(1);}}var f="package.json";function h(n){let s=n;for(;;){let a=path.join(s,f);if(fs.existsSync(a))return a;let t=path.resolve(s,"..");if(t===s)break;s=t;}return null}var r=d("tailwindcss");function m(){let n=[{Name:"Package JSON",Status:"\u2714\uFE0F"},{Name:"Tailwind",Status:r?"\u2714\uFE0F":"\u274C"}].sort((s,a)=>{let t=s.Status.includes("\u2714\uFE0F"),o=a.Status.includes("\u2714\uFE0F");return t&&!o?-1:!t&&o?1:0});e.log("Hello There!"),e.log("Here are the features detected in your project:"),e.table(n),e.log(),e.log("Dear Developer"),e.log(),e.log("Thanks a lot for using '@szum-tech/prettier-config'"),e.log("If you like it, leave a star \u2B50 \u{1F449} https://github.com/JanSzewczyk/prettier-config"),e.log("And recommend to others"),e.log(),e.log("May the SZUMRAK be with You \u{1F680}\u{1F680}\u{1F680}"),e.log(),e.log();}m();var k={semi:true,useTabs:false,tabWidth:2,singleQuote:false,trailingComma:"none",bracketSpacing:true,bracketSameLine:false,printWidth:120,proseWrap:"always",quoteProps:"as-needed",requirePragma:false,htmlWhitespaceSensitivity:"css",embeddedLanguageFormatting:"auto"},b=["prettier-plugin-packagejson",r?"prettier-plugin-tailwindcss":null].filter(Boolean),w={tailwindAttributes:["class","className","ngClass",".*[cC]lassName"],tailwindFunctions:["classNames","clsx","cn"]},C={...k,plugins:b,...r?w:{}};
module.exports=C;