biome.json 7.9 KB

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