biome.json 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. {
  2. "$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
  3. "files": {
  4. "includes": [
  5. "**",
  6. "!**/.pnpm-store",
  7. "!**/.terraform",
  8. "!**/coverage",
  9. "!**/dist",
  10. "!**/.next",
  11. "!**/node_modules",
  12. "!**/vite.*.ts.timestamp-*",
  13. "!**/*.grit",
  14. "!**/turbo.json",
  15. "!**/.devcontainer",
  16. "!**/.stylelintrc.json",
  17. "!**/package.json",
  18. "!**/*.vendor-styles.prebuilt.*",
  19. "!.turbo",
  20. "!.vscode",
  21. "!.claude",
  22. "!tsconfig.base.json",
  23. "!apps/app/src/styles/prebuilt",
  24. "!apps/app/src/generated",
  25. "!apps/app/next-env.d.ts",
  26. "!apps/app/tmp",
  27. "!apps/pdf-converter/specs",
  28. "!apps/slackbot-proxy/src/public/bootstrap",
  29. "!packages/pdf-converter-client/src/index.ts",
  30. "!packages/pdf-converter-client/specs"
  31. ]
  32. },
  33. "formatter": {
  34. "enabled": true,
  35. "indentStyle": "space"
  36. },
  37. "assist": {
  38. "actions": {
  39. "source": {
  40. "organizeImports": {
  41. "level": "on",
  42. "options": {
  43. "groups": [
  44. ["react", "react/**"],
  45. ["next", "next/**"],
  46. [":NODE:", ":PACKAGE:"],
  47. ":BLANK_LINE:",
  48. ["@/**", "^/**"],
  49. ":BLANK_LINE:",
  50. "~/**",
  51. ":BLANK_LINE:",
  52. [
  53. ":PATH:",
  54. "!../**/*.css",
  55. "!./*.css",
  56. "!../**/*.scss",
  57. "!./*.scss"
  58. ],
  59. ":BLANK_LINE:",
  60. ["../**/*.scss", "../**/*.css"],
  61. ["./*.scss", "./*.css"]
  62. ]
  63. }
  64. }
  65. }
  66. }
  67. },
  68. "linter": {
  69. "enabled": true,
  70. "rules": {
  71. "recommended": true,
  72. "style": {
  73. "useThrowOnlyError": "error",
  74. "noParameterAssign": "warn",
  75. "noDefaultExport": "warn"
  76. },
  77. "suspicious": {
  78. "noConsole": "error",
  79. "noAlert": "error",
  80. "noVar": "error",
  81. "useAwait": "warn"
  82. },
  83. "performance": {
  84. "noAwaitInLoops": "warn"
  85. },
  86. "correctness": {
  87. "useUniqueElementIds": "warn"
  88. },
  89. "nursery": {
  90. "useMaxParams": "warn"
  91. }
  92. }
  93. },
  94. "javascript": {
  95. "formatter": {
  96. "quoteStyle": "single"
  97. },
  98. "parser": {
  99. "unsafeParameterDecoratorsEnabled": true
  100. }
  101. },
  102. "overrides": [
  103. {
  104. "includes": [
  105. "**/vite*.config.ts",
  106. "vitest*.config.ts",
  107. "**/declaration.d.ts"
  108. ],
  109. "linter": {
  110. "rules": {
  111. "style": {
  112. "noDefaultExport": "off"
  113. }
  114. }
  115. }
  116. },
  117. {
  118. "includes": ["bin/**"],
  119. "linter": {
  120. "rules": {
  121. "suspicious": {
  122. "noConsole": "off"
  123. }
  124. }
  125. }
  126. },
  127. {
  128. "includes": ["bin/data-migrations/**"],
  129. "linter": {
  130. "rules": {
  131. "suspicious": {
  132. "noVar": "off"
  133. },
  134. "correctness": {
  135. "noInnerDeclarations": "off"
  136. }
  137. }
  138. }
  139. },
  140. {
  141. "includes": ["apps/pdf-converter/**", "./apps/slackbot-proxy/**"],
  142. "linter": {
  143. "rules": {
  144. "style": {
  145. "useImportType": "off"
  146. }
  147. }
  148. }
  149. },
  150. {
  151. "includes": ["apps/app/**"],
  152. "linter": {
  153. "rules": {
  154. "style": {
  155. "noRestrictedImports": {
  156. "level": "error",
  157. "options": {
  158. "paths": {
  159. "axios": "Please use src/utils/axios instead."
  160. }
  161. }
  162. }
  163. }
  164. }
  165. }
  166. },
  167. {
  168. "includes": [
  169. "apps/app/src/stores-universal/**",
  170. "apps/app/src/utils/**",
  171. "apps/app/src/models/**",
  172. "apps/app/src/services/**",
  173. "apps/app/src/pages/**",
  174. "apps/app/src/server/**",
  175. "apps/app/src/components/**"
  176. ],
  177. "linter": {
  178. "rules": {
  179. "style": {
  180. "noRestrictedImports": {
  181. "level": "error",
  182. "options": {
  183. "paths": {
  184. "axios": "Please use src/utils/axios instead."
  185. },
  186. "patterns": [
  187. {
  188. "group": ["~/client/**", "**/client/**", "client/**"],
  189. "message": "Importing from client/ directories is restricted."
  190. }
  191. ]
  192. }
  193. }
  194. }
  195. }
  196. }
  197. },
  198. {
  199. "includes": ["apps/app/src/server/models/**"],
  200. "plugins": ["apps/app/src/server/models/.biome/plugins/no-populate.grit"]
  201. }
  202. ]
  203. }