2023-03-13 08:37:23 +00:00
|
|
|
const baseConfig = require('@sourcegraph/prettierrc')
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
...baseConfig,
|
|
|
|
|
plugins: [...(baseConfig.plugins || []), '@ianvs/prettier-plugin-sort-imports'],
|
|
|
|
|
importOrder: [
|
|
|
|
|
'^react$',
|
|
|
|
|
'<THIRD_PARTY_MODULES>', // Note: Any unmatched modules will be placed here
|
|
|
|
|
'^@sourcegraph/(.*)$', // Any internal module
|
|
|
|
|
'^\\$.*$', // Svelte imports
|
2023-04-03 19:29:05 +00:00
|
|
|
'^(?!.*.s?css$)(?!\\.\\/)(\\.\\.\\/.*$|\\.\\.$)', // Matches parent directory paths, e.g. "../Foo", or "../../Foo". or ".."
|
|
|
|
|
'^(?!.*.s?css$)(\\.\\/.*$|\\.$)', // Matches sibling directory paths, e.g. "./Foo" or ".",
|
|
|
|
|
'.*\\.s?css$', // SCSS imports. Note: This must be last to ensure predictable styling.
|
2023-03-13 08:37:23 +00:00
|
|
|
],
|
|
|
|
|
importOrderSeparation: true,
|
|
|
|
|
importOrderMergeDuplicateImports: true,
|
|
|
|
|
importOrderBuiltinModulesToTop: true,
|
|
|
|
|
importOrderCaseInsensitive: true,
|
|
|
|
|
}
|