From 04572a8e5081b1e4871e273cde9dbaaa44c52fe0 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Wed, 13 Mar 2024 21:43:44 +0000 Subject: structure: Create apps dir and copy tooling dir from t3-turbo repo --- tooling/prettier/index.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tooling/prettier/index.js (limited to 'tooling/prettier/index.js') diff --git a/tooling/prettier/index.js b/tooling/prettier/index.js new file mode 100644 index 00000000..08618ae6 --- /dev/null +++ b/tooling/prettier/index.js @@ -0,0 +1,36 @@ +import { fileURLToPath } from "url"; + +/** @typedef {import("prettier").Config} PrettierConfig */ +/** @typedef {import("prettier-plugin-tailwindcss").PluginOptions} TailwindConfig */ +/** @typedef {import("@ianvs/prettier-plugin-sort-imports").PluginConfig} SortImportsConfig */ + +/** @type { PrettierConfig | SortImportsConfig | TailwindConfig } */ +const config = { + plugins: [ + "@ianvs/prettier-plugin-sort-imports", + "prettier-plugin-tailwindcss", + ], + tailwindConfig: fileURLToPath( + new URL("../../tooling/tailwind/web.ts", import.meta.url), + ), + tailwindFunctions: ["cn", "cva"], + importOrder: [ + "", + "^(react/(.*)$)|^(react$)|^(react-native(.*)$)", + "^(next/(.*)$)|^(next$)", + "^(expo(.*)$)|^(expo$)", + "", + "", + "^@hoarder", + "^@hoarder/(.*)$", + "", + "^[.|..|~]", + "^~/", + "^[../]", + "^[./]", + ], + importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"], + importOrderTypeScriptVersion: "4.4.0", +}; + +export default config; -- cgit v1.2.3-70-g09d2