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. "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. "noSkippedTests": "error",
  69. "noFocusedTests": "error",
  70. "noDuplicateTestHooks": "error"
  71. },
  72. "style": {
  73. "noCommaOperator": "error",
  74. "noShoutyConstants": "error",
  75. "noParameterProperties": "error",
  76. "noVar": "error",
  77. "useConst": "error",
  78. "useShorthandFunctionType": "error",
  79. "useExportType": "error",
  80. "useImportType": "error",
  81. "useNodejsImportProtocol": "error",
  82. "useLiteralEnumMembers": "error",
  83. "useEnumInitializers": "error",
  84. "useAsConstAssertion": "error",
  85. "useBlockStatements": "error"
  86. }
  87. }
  88. },
  89. "files": {
  90. "ignoreUnknown": true,
  91. "ignore": [
  92. "**/*/trace.json",
  93. "static/app/data/world.json",
  94. "**/*.sourcemap.js",
  95. "**/*.min.js",
  96. "fixtures",
  97. ".devenv",
  98. "package.json"
  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. }