biome.json 4.8 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. "useIsNan": "error",
  23. "noUnusedPrivateClassMembers": "error",
  24. "noInvalidUseBeforeDeclaration": "error",
  25. "noNodejsModules": "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. "noRestrictedImports": {
  39. "level": "warn",
  40. "options": {
  41. "paths": {}
  42. }
  43. }
  44. },
  45. "performance": {
  46. "noBarrelFile": "error"
  47. },
  48. "security": {
  49. "noDangerouslySetInnerHtmlWithChildren": "error"
  50. },
  51. "suspicious": {
  52. "noDebugger": "error",
  53. "noDoubleEquals": "error",
  54. "noDuplicateJsxProps": "error",
  55. "noDuplicateObjectKeys": "error",
  56. "noDuplicateParameters": "error",
  57. "noDuplicateCase": "error",
  58. "noFallthroughSwitchClause": "error",
  59. "noRedeclare": "error",
  60. "noSparseArray": "error",
  61. "noUnsafeDeclarationMerging": "error",
  62. "noUnsafeNegation": "error",
  63. "useIsArray": "error",
  64. "noApproximativeNumericConstant": "error",
  65. "noMisrefactoredShorthandAssign": "error",
  66. "useAwait": "error",
  67. "useNamespaceKeyword": "error",
  68. "noFocusedTests": "error",
  69. "noDuplicateTestHooks": "error"
  70. },
  71. "style": {
  72. "noCommaOperator": "error",
  73. "noShoutyConstants": "error",
  74. "noParameterProperties": "error",
  75. "noVar": "error",
  76. "useConst": "error",
  77. "useShorthandFunctionType": "error",
  78. "useExportType": "error",
  79. "useImportType": "error",
  80. "useNodejsImportProtocol": "error",
  81. "useLiteralEnumMembers": "error",
  82. "useEnumInitializers": "error",
  83. "useAsConstAssertion": "error",
  84. "useBlockStatements": "error"
  85. }
  86. }
  87. },
  88. "files": {
  89. "ignoreUnknown": true,
  90. "ignore": [
  91. "**/*/trace.json",
  92. "static/app/data/world.json",
  93. "**/*.sourcemap.js",
  94. "**/*.min.js",
  95. "fixtures",
  96. ".devenv",
  97. "package.json"
  98. ]
  99. },
  100. "css": {
  101. "formatter": {
  102. "enabled": false
  103. },
  104. "linter": {
  105. "enabled": false
  106. }
  107. },
  108. "formatter": {
  109. "enabled": true,
  110. "formatWithErrors": true,
  111. "indentStyle": "space",
  112. "indentWidth": 2,
  113. "lineEnding": "lf",
  114. "ignore": ["tests/**/*.json"]
  115. },
  116. "javascript": {
  117. "formatter": {
  118. "enabled": false,
  119. "lineWidth": 90,
  120. "quoteStyle": "single",
  121. "jsxQuoteStyle": "double",
  122. "quoteProperties": "asNeeded",
  123. "trailingCommas": "es5",
  124. "semicolons": "always",
  125. "arrowParentheses": "asNeeded",
  126. "bracketSpacing": false,
  127. "bracketSameLine": false
  128. }
  129. },
  130. "json": {
  131. "formatter": {
  132. "enabled": true
  133. },
  134. "parser": {
  135. "allowComments": true,
  136. "allowTrailingCommas": true
  137. }
  138. },
  139. "overrides": [
  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. "correctness": {
  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. }