diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..4758c44 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,30 @@ +# project +node_modules +.DS_Store +bun.lockb + +# VERCEL +.vercel +.output + +# Turborepo +.turbo + +# Db +**/prisma/client + +# Remix +**/public/build/** +**/build/** + +# Next.js build output +**/.next/** + +# Packages +**/dist/** + +# Docker +docker/*/data + +# Storybook stuff +**/storybook-static/** diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..25d77af --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,36 @@ +// @ts-check + +/** @type {import("@ianvs/prettier-plugin-sort-imports").PrettierConfig} */ +const config = { + arrowParens: 'avoid', + bracketSpacing: false, + embeddedLanguageFormatting: 'auto', + endOfLine: 'lf', + htmlWhitespaceSensitivity: 'css', + insertPragma: false, + jsxSingleQuote: false, + printWidth: 80, + proseWrap: 'always', + quoteProps: 'as-needed', + requirePragma: false, + semi: false, + singleQuote: true, + tabWidth: 2, + trailingComma: 'all', + useTabs: false, + + plugins: ['@ianvs/prettier-plugin-sort-imports'], + + // -- @ianvs/prettier-plugin-sort-imports options + importOrder: [ + '', // Node.js built-in modules + '', // Imports not matched by other special words or groups. + '', + '^[.]', // relative imports + ], + importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'], + importOrderTypeScriptVersion: '5.0.0', + // -- @ianvs/prettier-plugin-sort-imports options +} + +export default config diff --git a/bun.lockb b/bun.lockb index c7b2f77..bcada25 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index b4a258a..3a99aa0 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,13 @@ "name": "autogen", "module": "src/index.ts", "type": "module", + "scripts": { + "format": "prettier --write ." + }, "devDependencies": { - "bun-types": "latest" + "@ianvs/prettier-plugin-sort-imports": "^4.1.0", + "bun-types": "latest", + "prettier": "^3.0.3" }, "peerDependencies": { "typescript": "^5.0.0"