mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 17:35:10 +03:00
This PR switches the sort imports plugin to @ianvs/prettier-plugin-sort-imports which is more reliable and merges imports from the same file (the old one reported them as error). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated import-sorting tooling and related configuration to improve consistency of import ordering and formatting across the codebase, simplifying rules and adjusting behavior for private/internal paths to produce more predictable diffs and clearer code style in development. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
29 lines
677 B
JavaScript
29 lines
677 B
JavaScript
let options = {
|
|
trailingComma: 'es5',
|
|
tabWidth: 2,
|
|
semi: false,
|
|
singleQuote: true,
|
|
printWidth: 100,
|
|
endOfLine: 'lf',
|
|
sqlKeywordCase: 'lower',
|
|
plugins: ['prettier-plugin-sql-cst'],
|
|
overrides: [
|
|
{
|
|
files: '**/*.json',
|
|
options: { parser: 'json' },
|
|
},
|
|
],
|
|
}
|
|
|
|
// Disable sorting imports when running a prettier command in CI. This is to make the sorting work in editors
|
|
// for easier migration.
|
|
if (process.env.SORT_IMPORTS !== 'false') {
|
|
options = {
|
|
...options,
|
|
plugins: [...options.plugins, '@ianvs/prettier-plugin-sort-imports'],
|
|
importOrder: ['<THIRD_PARTY_MODULES>', '', '^(@|\\.{1,2})/(.*)$'],
|
|
}
|
|
}
|
|
|
|
export default options
|