biome.json 4.7 KB

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