-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy path.prettierrc.js
More file actions
57 lines (52 loc) · 1.39 KB
/
.prettierrc.js
File metadata and controls
57 lines (52 loc) · 1.39 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
'use strict'
const importOrder = [
'^(react)(.*)$',
'<THIRD_PARTY_MODULES>',
'',
'^@opentrons/(.*)$',
'',
'^/(.*)/(?!assets)(.*)$',
'',
'^[./](?!.*\\.(png|jpg|jpeg|gif|svg|webm|mp4)$)',
'',
'<TYPES>',
'<TYPES>^(react)(.*)$',
'<TYPES><THIRD_PARTY_MODULES>',
'<TYPES>^@opentrons/(.*)$',
'<TYPES>^/(.*)/(?!assets)(.*)$',
'<TYPES>^[./]',
'',
'.*/assets/.*',
'.*\\.(png|jpg|jpeg|gif|svg|webm|mp4)$',
]
module.exports = {
// --- STANDARD PRETTIER OPTIONS (Global) ---
// These apply to ALL files (JS, JSON, MD, YAML)
printWidth: 80,
tabWidth: 2,
useTabs: false,
semi: false,
singleQuote: true,
jsxSingleQuote: false,
trailingComma: 'es5',
bracketSpacing: true,
bracketSameLine: false,
arrowParens: 'avoid',
endOfLine: 'lf',
// ⚠️ CRITICAL: NO PLUGINS OR PLUGIN OPTIONS HERE ⚠️
// If you put importOrder here, JSON/MD files will warn because they don't have the plugin.
overrides: [
{
// --- CONFIGURATION FOR JS/TS ONLY ---
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
options: {
// 1. Load the plugin ONLY for these files
// We use require.resolve to satisfy pnpm
plugins: [require.resolve('@ianvs/prettier-plugin-sort-imports')],
// 2. Apply the options ONLY for these files
importOrder,
importOrderParserPlugins: ['typescript', 'jsx', 'decorators-legacy'],
},
},
],
}