biome.jsonc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. {
  2. "$schema": "https://biomejs.dev/schemas/2.1.4/schema.json",
  3. "vcs": {
  4. "enabled": true,
  5. "clientKind": "git",
  6. "useIgnoreFile": true,
  7. "defaultBranch": "main"
  8. },
  9. "assist": {
  10. "enabled": true,
  11. "actions": {
  12. "source": {
  13. "organizeImports": "on",
  14. "useSortedAttributes": "on"
  15. }
  16. }
  17. },
  18. "linter": {
  19. "enabled": true,
  20. "domains": {
  21. "react": "recommended"
  22. },
  23. // Ideally we would want to turn on all the rules that are currently off,
  24. // keeping them off currently to make sure only changes on the migrations
  25. // are included in the initial PR before we apply the format and lint changes.
  26. // TODO: turn on all rules that are currently off if applicable.
  27. // TODO: Remove --diagnostic-level=error from CI commands.
  28. "rules": {
  29. "recommended": true,
  30. "correctness": {
  31. "useExhaustiveDependencies": "off",
  32. "noUndeclaredVariables": "off",
  33. "noEmptyPattern": "off",
  34. "useJsxKeyInIterable": "off",
  35. "noInnerDeclarations": "off",
  36. "useHookAtTopLevel": "off",
  37. "useYield": "off",
  38. "noConstructorReturn": "off",
  39. "noInvalidPositionAtImportRule": "off",
  40. "noSwitchDeclarations": "off",
  41. "noUnusedImports": "error"
  42. },
  43. "a11y": "off",
  44. "style": {
  45. "useNodejsImportProtocol": "off",
  46. "useImportType": "off",
  47. "useBlockStatements": "warn",
  48. "useNamingConvention": "off",
  49. "useThrowOnlyError": "info",
  50. "useConsistentArrayType": "off",
  51. "noParameterAssign": "off",
  52. "useAsConstAssertion": "off",
  53. "useDefaultParameterLast": "off",
  54. "noNonNullAssertion": "off",
  55. "useEnumInitializers": "off",
  56. "useSelfClosingElements": "off",
  57. "useSingleVarDeclarator": "off",
  58. "useNumberNamespace": "off",
  59. "noInferrableTypes": "off",
  60. "useTemplate": "off",
  61. "noUselessElse": "off"
  62. },
  63. "suspicious": {
  64. "noDoubleEquals": "warn",
  65. "noImplicitAnyLet": "info",
  66. "noThenProperty": "off",
  67. "noAsyncPromiseExecutor": "off",
  68. "noImportAssign": "off",
  69. "noExplicitAny": "off",
  70. "noControlCharactersInRegex": "off",
  71. "noShadowRestrictedNames": "off",
  72. "noArrayIndexKey": "info",
  73. "noAssignInExpressions": "info"
  74. },
  75. "complexity": {
  76. "noUselessConstructor": "off",
  77. "useOptionalChain": "off",
  78. "noBannedTypes": "off",
  79. "useLiteralKeys": "off",
  80. "noUselessCatch": "off",
  81. "noUselessSwitchCase": "off",
  82. "noStaticOnlyClass": "off"
  83. },
  84. "security": {
  85. "noDangerouslySetInnerHtml": "info"
  86. }
  87. }
  88. },
  89. "formatter": {
  90. "enabled": true,
  91. "indentStyle": "tab",
  92. "indentWidth": 4,
  93. "lineWidth": 130,
  94. "lineEnding": "lf",
  95. "formatWithErrors": true
  96. },
  97. "javascript": {
  98. "formatter": {
  99. "semicolons": "asNeeded",
  100. "arrowParentheses": "always",
  101. "bracketSameLine": true,
  102. "bracketSpacing": true,
  103. "jsxQuoteStyle": "double",
  104. "quoteProperties": "asNeeded",
  105. "trailingCommas": "all"
  106. }
  107. },
  108. "json": {
  109. "formatter": {
  110. "trailingCommas": "none",
  111. "expand": "always"
  112. }
  113. },
  114. "files": {
  115. "includes": [
  116. "**",
  117. "!**/dist",
  118. "!**/dist-*",
  119. "!**/out",
  120. "!**/evals",
  121. "!**/playwright",
  122. "!**/test-results",
  123. "!**/node_modules",
  124. "!**/webview-ui/build",
  125. "!**/generated",
  126. "!**/proto",
  127. "!**/tests/specs"
  128. ]
  129. },
  130. "plugins": [
  131. "src/dev/grit/process-env.grit"
  132. ],
  133. "overrides": [
  134. {
  135. "includes": [
  136. "**",
  137. "!**/hosts/vscode/**",
  138. "!**/test/**",
  139. "!**/*.test.ts",
  140. "!src/dev/**",
  141. "!src/extension.ts",
  142. "!src/integrations/git/commit-message-generator.ts",
  143. "!src/integrations/terminal/**",
  144. "!src/core/controller/ui/openWalkthrough.ts"
  145. ],
  146. "plugins": [
  147. "src/dev/grit/vscode-api.grit"
  148. ]
  149. },
  150. {
  151. "includes": [
  152. "**",
  153. "!src/core/storage/state-migrations.ts",
  154. "!src/core/storage/FileContextTracker.ts",
  155. "!src/core/context/context-tracking/FileContextTracker.ts",
  156. "!src/common.ts",
  157. "!src/services/logging/distinctId.ts",
  158. "!src/core/storage/utils/state-helpers.ts",
  159. "!src/extension.ts"
  160. ],
  161. "plugins": [
  162. "src/dev/grit/use-cache-service.grit"
  163. ]
  164. }
  165. ]
  166. }