biome.json 4.6 KB

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