forked from supabase/supabase
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprettier.config.mjs
More file actions
36 lines (33 loc) · 961 Bytes
/
prettier.config.mjs
File metadata and controls
36 lines (33 loc) · 961 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
let options = {
trailingComma: 'es5',
tabWidth: 2,
semi: false,
singleQuote: true,
printWidth: 100,
endOfLine: 'lf',
sqlKeywordCase: 'lower',
sqlLiteralCase: 'lower',
sqlTypeCase: 'lower',
plugins: ['prettier-plugin-sql-cst'],
overrides: [
{
files: '**/*.json',
options: { parser: 'json' },
},
],
}
const sortImportsOptions = {
plugins: ['prettier-plugin-sql-cst', '@ianvs/prettier-plugin-sort-imports'],
importOrder: ['<THIRD_PARTY_MODULES>', '', '^(@|\\.{1,2})/(.*)$'],
}
// Disable sorting imports when running a prettier command in CI. This is to make the sorting work in editors
// for easier migration. Studio components are always sorted regardless of this flag.
if (process.env.SORT_IMPORTS !== 'false') {
options = { ...options, ...sortImportsOptions }
} else {
options.overrides.push({
files: 'apps/studio/**/*.{js,jsx,ts,tsx}',
options: sortImportsOptions,
})
}
export default options