biome.json 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251
  1. {
  2. "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
  3. "vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
  4. "files": { "ignoreUnknown": false },
  5. "formatter": {
  6. "enabled": true,
  7. "formatWithErrors": false,
  8. "indentStyle": "space",
  9. "indentWidth": 4,
  10. "lineEnding": "lf",
  11. "lineWidth": 110,
  12. "attributePosition": "auto",
  13. "bracketSameLine": false,
  14. "bracketSpacing": true,
  15. "expand": "auto",
  16. "useEditorconfig": true,
  17. "includes": [
  18. "**",
  19. "!**/generated-types.ts",
  20. "!**/lazy-extensions.module.ts",
  21. "!**/shared-extensions.module.ts",
  22. "!**/generated-graphql-shop-errors.ts",
  23. "!**/generated-graphql-admin-errors.ts"
  24. ]
  25. },
  26. "linter": {
  27. "enabled": true,
  28. "rules": { "recommended": false, "style": { "useBlockStatements": "off" } },
  29. "includes": [
  30. "**",
  31. "!**/node_modules/**",
  32. "!**/dist/**",
  33. "!**/generated*",
  34. "!**/*.js",
  35. "!**/*.d.ts",
  36. "!/packages/ui-devkit/scaffold/**/*",
  37. "!/packages/dev-server/load-testing/**/*",
  38. "!/docs/layouts/**/*"
  39. ]
  40. },
  41. "javascript": {
  42. "formatter": {
  43. "jsxQuoteStyle": "double",
  44. "quoteProperties": "asNeeded",
  45. "trailingCommas": "all",
  46. "semicolons": "always",
  47. "arrowParentheses": "asNeeded",
  48. "bracketSameLine": false,
  49. "quoteStyle": "single",
  50. "attributePosition": "auto",
  51. "bracketSpacing": true
  52. }
  53. },
  54. "html": {
  55. "formatter": {
  56. "indentScriptAndStyle": false,
  57. "selfCloseVoidElements": "always"
  58. }
  59. },
  60. "overrides": [
  61. { "includes": ["**/*.ts", "**/*.tsx"], "javascript": { "globals": [] } },
  62. {
  63. "includes": ["**/*.ts", "**/*.tsx"],
  64. "linter": {
  65. "rules": {
  66. "complexity": { "noArguments": "error" },
  67. "correctness": {
  68. "noConstAssign": "off",
  69. "noGlobalObjectCalls": "off",
  70. "noInvalidBuiltinInstantiation": "off",
  71. "noInvalidConstructorSuper": "off",
  72. "noSetterReturn": "off",
  73. "noUndeclaredVariables": "off",
  74. "noUnreachable": "off",
  75. "noUnreachableSuper": "off"
  76. },
  77. "style": { "useConst": "error" },
  78. "suspicious": {
  79. "noClassAssign": "off",
  80. "noDuplicateClassMembers": "off",
  81. "noDuplicateObjectKeys": "off",
  82. "noDuplicateParameters": "off",
  83. "noFunctionAssign": "off",
  84. "noImportAssign": "off",
  85. "noRedeclare": "off",
  86. "noUnsafeNegation": "off",
  87. "noVar": "error",
  88. "noWith": "off",
  89. "useGetterReturn": "off"
  90. }
  91. }
  92. }
  93. },
  94. {
  95. "includes": ["**/*.ts", "**/*.tsx"],
  96. "linter": {
  97. "rules": {
  98. "complexity": { "noUselessTypeConstraint": "error" },
  99. "correctness": { "noUnusedVariables": "error" },
  100. "style": {
  101. "noCommonJs": "error",
  102. "noNamespace": "error",
  103. "useArrayLiterals": "error",
  104. "useAsConstAssertion": "error"
  105. },
  106. "suspicious": {
  107. "noExplicitAny": "error",
  108. "noExtraNonNullAssertion": "error",
  109. "noMisleadingInstantiator": "error",
  110. "noNonNullAssertedOptionalChain": "error",
  111. "noUnsafeDeclarationMerging": "error",
  112. "useNamespaceKeyword": "error"
  113. }
  114. }
  115. }
  116. },
  117. { "includes": ["**/*.ts", "**/*.tsx"], "javascript": { "globals": [] } },
  118. {
  119. "includes": ["**/*.ts", "**/*.tsx"],
  120. "linter": {
  121. "rules": {
  122. "complexity": { "noArguments": "error" },
  123. "correctness": {
  124. "noConstAssign": "off",
  125. "noGlobalObjectCalls": "off",
  126. "noInvalidBuiltinInstantiation": "off",
  127. "noInvalidConstructorSuper": "off",
  128. "noSetterReturn": "off",
  129. "noUndeclaredVariables": "off",
  130. "noUnreachable": "off",
  131. "noUnreachableSuper": "off"
  132. },
  133. "style": { "useConst": "error" },
  134. "suspicious": {
  135. "noClassAssign": "off",
  136. "noDuplicateClassMembers": "off",
  137. "noDuplicateObjectKeys": "off",
  138. "noDuplicateParameters": "off",
  139. "noFunctionAssign": "off",
  140. "noImportAssign": "off",
  141. "noRedeclare": "off",
  142. "noUnsafeNegation": "off",
  143. "noVar": "error",
  144. "noWith": "off",
  145. "useGetterReturn": "off"
  146. }
  147. }
  148. }
  149. },
  150. {
  151. "includes": ["**/*.ts", "**/*.tsx"],
  152. "linter": {
  153. "rules": {
  154. "complexity": { "noUselessTypeConstraint": "error" },
  155. "correctness": { "noUnusedVariables": "error" },
  156. "style": {
  157. "noCommonJs": "error",
  158. "noNamespace": "error",
  159. "useArrayLiterals": "error",
  160. "useAsConstAssertion": "error"
  161. },
  162. "suspicious": {
  163. "noExplicitAny": "error",
  164. "noExtraNonNullAssertion": "error",
  165. "noMisleadingInstantiator": "error",
  166. "noNonNullAssertedOptionalChain": "error",
  167. "noUnsafeDeclarationMerging": "error",
  168. "useAwait": "error",
  169. "useNamespaceKeyword": "error"
  170. }
  171. }
  172. }
  173. },
  174. {
  175. "includes": ["**/*.ts", "**/*.tsx"],
  176. "javascript": { "globals": ["exports"] },
  177. "linter": {
  178. "rules": {
  179. "complexity": {
  180. "noUselessTypeConstraint": "error",
  181. "noUselessUndefinedInitialization": "error",
  182. "useLiteralKeys": "error"
  183. },
  184. "correctness": {
  185. "noInvalidConstructorSuper": "error",
  186. "noInvalidUseBeforeDeclaration": "off",
  187. "noPrecisionLoss": "error",
  188. "noUnsafeFinally": "error",
  189. "noUnusedLabels": "error",
  190. "noUnusedVariables": "off",
  191. "useIsNan": "error",
  192. "useParseIntRadix": "error",
  193. "useValidTypeof": "off"
  194. },
  195. "security": { "noGlobalEval": "error" },
  196. "style": {
  197. "noInferrableTypes": "error",
  198. "noNamespace": "error",
  199. "noNonNullAssertion": "error",
  200. "useArrayLiterals": "error",
  201. "useAsConstAssertion": "error",
  202. "useConsistentArrayType": {
  203. "level": "error",
  204. "options": { "syntax": "shorthand" }
  205. },
  206. "useConsistentBuiltinInstantiation": "error",
  207. "useConsistentMemberAccessibility": {
  208. "level": "off",
  209. "options": { "accessibility": "explicit" }
  210. },
  211. "useConsistentTypeDefinitions": "off",
  212. "useConst": "error",
  213. "useForOf": "error",
  214. "useShorthandFunctionType": "error",
  215. "useSingleVarDeclarator": "error",
  216. "useUnifiedTypeSignatures": "error"
  217. },
  218. "suspicious": {
  219. "noBitwiseOperators": "error",
  220. "noConsole": "error",
  221. "noDebugger": "error",
  222. "noDoubleEquals": "error",
  223. "noEmptyBlockStatements": "error",
  224. "noExplicitAny": "off",
  225. "noExtraNonNullAssertion": "error",
  226. "noFallthroughSwitchClause": "error",
  227. "noMisleadingInstantiator": "error",
  228. "noNonNullAssertedOptionalChain": "error",
  229. "noVar": "error",
  230. "useAdjacentOverloadSignatures": "error",
  231. "useAwait": "warn",
  232. "useGuardForIn": "error",
  233. "useNamespaceKeyword": "error"
  234. }
  235. }
  236. }
  237. },
  238. {
  239. "includes": ["packages/ui-devkit/src/client/**/*"],
  240. "javascript": { "globals": [] }
  241. },
  242. {
  243. "includes": ["packages/ui-devkit/src/compiler/**/*"],
  244. "javascript": { "globals": [] }
  245. }
  246. ],
  247. "assist": {
  248. "enabled": true,
  249. "actions": { "source": { "organizeImports": "on" } }
  250. }
  251. }