biome.json 4.8 KB

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