biome.json 4.8 KB

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