diff options
Diffstat (limited to 'tooling/prettier/index.js')
| -rw-r--r-- | tooling/prettier/index.js | 36 |
1 files changed, 36 insertions, 0 deletions
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: [ + "<TYPES>", + "^(react/(.*)$)|^(react$)|^(react-native(.*)$)", + "^(next/(.*)$)|^(next$)", + "^(expo(.*)$)|^(expo$)", + "<THIRD_PARTY_MODULES>", + "", + "<TYPES>^@hoarder", + "^@hoarder/(.*)$", + "", + "<TYPES>^[.|..|~]", + "^~/", + "^[../]", + "^[./]", + ], + importOrderParserPlugins: ["typescript", "jsx", "decorators-legacy"], + importOrderTypeScriptVersion: "4.4.0", +}; + +export default config; |
