-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbiome.jsonc
124 lines (124 loc) · 3.99 KB
/
biome.jsonc
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"files": {
"include": ["**/*.ts", "**/*.tsx", "**/*.json"],
"ignore": [".idea", "dist"]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
// Enable ALL by default (not just recommended), disable as-needed.
"all": true,
"nursery": {
"recommended": true,
"useConsistentMemberAccessibility": {
"level": "warn",
"options": {
"accessibility": "explicit"
}
}
},
"complexity": {
// Learn the language.
"noVoid": "off"
},
"correctness": {
// I generally know what I'm doing.
"noNodejsModules": "off",
// I'd like to use it but with an ignore list, which is not possible atm.
"noUndeclaredDependencies": "off",
// PROJECT-SPECIFIC: We do not use React and this rule gives false positives on NestJS.
"useHookAtTopLevel": "off",
// PROJECT-SPECIFIC: We do not use a runtime/bundler that necessitates this.
"useImportExtensions": "off"
},
"performance": {
// Virtually not an issue with modern bundlers.
// It can indeed cause slower builds though, but my projects generally
// don't have much unused symbols.
"noBarrelFile": "off",
// Same as noBarrelFile.
"noReExportAll": "off"
},
"security": {
// It's already pretty clear when you use it
// (`dangerouslySetInnerHTML={{ __html: html }}`)
"noDangerouslySetInnerHtml": "off"
},
"style": {
// I must admit I just like it.
"noCommaOperator": "off",
// Same reason as performance.noBarrelFile.
"noNamespaceImport": "off",
"noParameterProperties": "off",
// I like using template literals for hardcoded english strings, ex. exception error
// messages. This makes spotting them easier, and also it makes it easier to use double or
// single quotes.
"noUnusedTemplateLiteral": "off",
// I don't like that it forces "===" over "==" on 0, and it doesn't support undefined values
// well, i.e. it thinks `arr?.length > 0` is valid, while in TS it is not, so a simple
// `arr?.length` would need to be rewritten to `(arr?.length ?? 0) > 0`.
"useExplicitLengthCheck": "off",
"useFilenamingConvention": {
"level": "error",
"options": {
"filenameCases": ["kebab-case"]
}
},
// PROJECT-SPECIFIC: The rule does not play well with DI in NestJS and Angular.
// No fix is easily conceivable, see:
// https://biomejs.dev/linter/rules/use-import-type
"useImportType": "off",
// Keep it but with a few exceptions.
"useNamingConvention": {
"level": "error",
"options": {
"strictCase": false
}
}
},
"suspicious": {
// If I use any level above ".log()", I know what I'm doing.
"noConsole": {
"level": "warn",
"options": {
"allow": ["info", "warn", "error"]
}
},
// Double equals is not THAT bad, although I understand why the rule exists.
// If you know the language you can avoid the pitfalls and even enjoy the benefits of loose
// equality! Yep, hot take.
"noDoubleEquals": "off"
}
}
},
"formatter": {
"formatWithErrors": true,
"lineEnding": "lf",
"indentStyle": "space",
"indentWidth": 4,
"lineWidth": 100
},
"json": {
"formatter": {
"indentWidth": 2
}
},
"javascript": {
"parser": {
"unsafeParameterDecoratorsEnabled": true
},
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "single",
"semicolons": "always",
"arrowParentheses": "asNeeded",
"quoteProperties": "preserve",
"trailingCommas": "none",
"bracketSameLine": true
}
}
}