biome.json 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. {
  2. "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  3. "vcs": {
  4. "enabled": true,
  5. "clientKind": "git",
  6. "useIgnoreFile": true,
  7. "defaultBranch": "master"
  8. },
  9. "organizeImports": {
  10. "enabled": false
  11. },
  12. "linter": {
  13. "enabled": true,
  14. "rules": {
  15. "recommended": false,
  16. "a11y": {
  17. "noBlankTarget": "error"
  18. },
  19. "correctness": {
  20. "noGlobalObjectCalls": "error",
  21. "noUnreachable": "error",
  22. "useHookAtTopLevel": "error",
  23. "useIsNan": "error",
  24. "noUnusedPrivateClassMembers": "error",
  25. "noInvalidUseBeforeDeclaration": "error"
  26. },
  27. "complexity": {
  28. "useFlatMap": "error",
  29. "useOptionalChain": "error",
  30. "noEmptyTypeParameters": "error",
  31. "noUselessLoneBlockStatements": "error",
  32. "noUselessEmptyExport": "error",
  33. "noUselessConstructor": "error",
  34. "noUselessTypeConstraint": "error",
  35. "noExcessiveNestedTestSuites": "error"
  36. },
  37. "nursery": {
  38. "noDuplicateJsonKeys": "error",
  39. "noNodejsModules": "error"
  40. },
  41. "performance": {
  42. "noBarrelFile": "error"
  43. },
  44. "security": {
  45. "noDangerouslySetInnerHtmlWithChildren": "error"
  46. },
  47. "suspicious": {
  48. "noDebugger": "error",
  49. "noDoubleEquals": "error",
  50. "noDuplicateJsxProps": "error",
  51. "noDuplicateObjectKeys": "error",
  52. "noDuplicateParameters": "error",
  53. "noDuplicateCase": "error",
  54. "noFallthroughSwitchClause": "error",
  55. "noRedeclare": "error",
  56. "noSparseArray": "error",
  57. "noUnsafeDeclarationMerging": "error",
  58. "noUnsafeNegation": "error",
  59. "useIsArray": "error",
  60. "noApproximativeNumericConstant": "error",
  61. "noMisrefactoredShorthandAssign": "error",
  62. "useAwait": "error",
  63. "useNamespaceKeyword": "error",
  64. "noSkippedTests": "error",
  65. "noFocusedTests": "error",
  66. "noDuplicateTestHooks": "error"
  67. },
  68. "style": {
  69. "noCommaOperator": "error",
  70. "noShoutyConstants": "error",
  71. "noParameterProperties": "error",
  72. "noVar": "error",
  73. "useConst": "error",
  74. "useShorthandFunctionType": "error",
  75. "useExportType": "error",
  76. "useImportType": "error",
  77. "useNodejsImportProtocol": "error",
  78. "useLiteralEnumMembers": "error",
  79. "useEnumInitializers": "error",
  80. "useAsConstAssertion": "error"
  81. }
  82. }
  83. },
  84. "files": {
  85. "ignoreUnknown": true,
  86. "ignore": [
  87. "**/*/trace.json",
  88. "static/app/data/world.json",
  89. "**/*.sourcemap.js",
  90. "**/*.min.js",
  91. "fixtures",
  92. ".devenv"
  93. ]
  94. },
  95. "formatter": {
  96. "enabled": true,
  97. "formatWithErrors": true,
  98. "indentStyle": "space",
  99. "indentWidth": 2,
  100. "lineEnding": "lf",
  101. "ignore": ["tests/**/*.json"]
  102. },
  103. "javascript": {
  104. "formatter": {
  105. "enabled": false,
  106. "lineWidth": 90,
  107. "quoteStyle": "single",
  108. "jsxQuoteStyle": "double",
  109. "quoteProperties": "asNeeded",
  110. "trailingComma": "es5",
  111. "semicolons": "always",
  112. "arrowParentheses": "asNeeded",
  113. "bracketSpacing": false,
  114. "bracketSameLine": false
  115. }
  116. },
  117. "json": {
  118. "formatter": {
  119. "enabled": true
  120. }
  121. },
  122. "overrides": [
  123. {
  124. "include": [
  125. "biome.json",
  126. "config/tsconfig.*",
  127. "tsconfig.json",
  128. ".vscode/*"
  129. ],
  130. "json": {
  131. "parser": {
  132. "allowComments": true,
  133. "allowTrailingCommas": true
  134. }
  135. }
  136. },
  137. {
  138. "include": [
  139. "api-docs/*.ts",
  140. "build-utils/*.ts",
  141. "config/*.ts",
  142. "scripts",
  143. "tests/js/sentry-test/loadFixtures.ts",
  144. "tests/js/jest-pegjs-transform.js",
  145. "tests/js/setup.ts",
  146. "tests/js/test-balancer/index.js",
  147. "*.config.ts"
  148. ],
  149. "linter": {
  150. "rules": {
  151. "nursery": {
  152. "noNodejsModules": "off"
  153. }
  154. }
  155. }
  156. },
  157. {
  158. "include": ["src/sentry/templates/sentry/error-page-embed.js"],
  159. "linter": {
  160. "rules": {
  161. "style": {
  162. "noVar": "off"
  163. }
  164. }
  165. }
  166. },
  167. {
  168. "include": [
  169. "static/app/utils/replays/types.tsx",
  170. "static/app/utils/queryClient.tsx",
  171. "static/app/views/performance/traceDetails/styles.tsx",
  172. "static/app/icons/index.tsx",
  173. "static/app/components/tabs/index.tsx",
  174. "static/app/components/sparklines/line.tsx",
  175. "static/app/types/index.tsx",
  176. "tests/js/sentry-test/reactTestingLibrary.tsx",
  177. "tests/js/sentry-test/index.tsx"
  178. ],
  179. "linter": {
  180. "rules": {
  181. "performance": {
  182. "noBarrelFile": "off"
  183. }
  184. }
  185. }
  186. }
  187. ]
  188. }