Open Conaclos opened 3 months ago
Would love to have this improved such that we can replace the following prettier config:
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 */
/** @satisfies { PrettierConfig | SortImportsConfig | TailwindConfig } */
const config = {
arrowParens: 'always',
singleQuote: true,
tabWidth: 2,
trailingComma: 'all',
singleAttributePerLine: true,
jsxSingleQuote: true,
plugins: [
'@ianvs/prettier-plugin-sort-imports',
'prettier-plugin-tailwindcss',
],
tailwindConfig: fileURLToPath(
new URL('../../packages/theme/tailwind.web.ts', import.meta.url),
),
tailwindFunctions: ['cn', 'cva', 'tw'],
importOrder: [
'<TYPES>',
'<TYPES>^@org-monorepo',
'<TYPES>^[@/]',
'<TYPES>^[./|../]',
'',
'^(react/(.*)$)|^(react$)|^(react-native(.*)$)',
'^(next/(.*)$)|^(next$)',
'^(expo(.*)$)|^(expo$)',
'<BUILTIN_MODULES>', // Node.js built-in modules
'<THIRD_PARTY_MODULES>', // Imports not matched by other special words or groups.
'',
'^@org-monorepo/enums/(.*)$',
'',
'^@org-monorepo/(.*)-utils/(.*)$',
'',
'^@org-monorepo/components/(.*)$',
'',
'^@org-monorepo/(.*)$',
'',
'^@/types(.*)$',
'',
'^@/utils/(.*)$',
'',
'^@/components/(.*)$',
'',
'^@/(.*)$',
'',
'^[../]',
'^[./]',
],
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
};
export default config;
yeah.... give us a way to do the grouping automatically
The issue has been funded! I will start work in a week.
Description
We recently published an RFC to improve the Biome import sorter.
This issue tracks the implementation of the RFC. The main goal of this implementation is to:
export from
statementsWe will provide a
legacy
configuration to enable the old way of sorting imports. By disabling this configuration, the new system will be used.Upvote & Fund