biome.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  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. "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": false,
  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. "trailingComma": "es5",
  119. "semicolons": "always",
  120. "arrowParentheses": "asNeeded",
  121. "bracketSpacing": false,
  122. "bracketSameLine": false
  123. }
  124. },
  125. "json": {
  126. "formatter": {
  127. "enabled": true
  128. }
  129. },
  130. "overrides": [
  131. {
  132. "include": ["biome.json", "config/tsconfig.*", "tsconfig.json", ".vscode/*"],
  133. "json": {
  134. "parser": {
  135. "allowComments": true,
  136. "allowTrailingCommas": true
  137. }
  138. }
  139. },
  140. {
  141. "include": [
  142. "api-docs/*.ts",
  143. "build-utils/*.ts",
  144. "config/*.ts",
  145. "scripts",
  146. "tests/js/sentry-test/loadFixtures.ts",
  147. "tests/js/jest-pegjs-transform.js",
  148. "tests/js/setup.ts",
  149. "tests/js/test-balancer/index.js",
  150. "*.config.ts"
  151. ],
  152. "linter": {
  153. "rules": {
  154. "nursery": {
  155. "noNodejsModules": "off"
  156. }
  157. }
  158. }
  159. },
  160. {
  161. "include": ["src/sentry/templates/sentry/error-page-embed.js"],
  162. "linter": {
  163. "rules": {
  164. "style": {
  165. "noVar": "off"
  166. }
  167. }
  168. }
  169. },
  170. {
  171. "include": [
  172. "static/app/utils/replays/types.tsx",
  173. "static/app/utils/queryClient.tsx",
  174. "static/app/views/performance/traceDetails/styles.tsx",
  175. "static/app/icons/index.tsx",
  176. "static/app/components/tabs/index.tsx",
  177. "static/app/components/sparklines/line.tsx",
  178. "static/app/types/index.tsx",
  179. "tests/js/sentry-test/reactTestingLibrary.tsx",
  180. "tests/js/sentry-test/index.tsx"
  181. ],
  182. "linter": {
  183. "rules": {
  184. "performance": {
  185. "noBarrelFile": "off"
  186. }
  187. }
  188. }
  189. }
  190. ]
  191. }