{
  "root": false,
  "$schema": "../../../node_modules/@biomejs/biome/configuration_schema.json",
  "files": {
    "ignoreUnknown": true,
    "includes": [
      "**",
      "!!**/_generated",
      "!!**/*.gen.*",
      "!!**/.next",
      "!!**/next-env.d.ts",
      "!!**/.nuxt",
      "!!**/.output",
      "!!**/.svelte-kit",
      "!!**/.vitepress/cache",
      "!!**/.vitepress/dist",
      "!!**/dist",
      "!!**/build",
      "!!**/out",
      "!!**/.turbo",
      "!!**/.vercel",
      "!!**/.netlify",
      "!!**/storybook-static",
      "!!**/.docusaurus",
      "!!**/.cache",
      "!!**/public/build",
      "!!**/.parcel-cache",
      "!!**/.vite",
      "!!**/.astro",
      "!!**/_astro",
      "!!**/coverage",
      "!!**/.nyc_output",
      "!!**/*.generated.*",
      "!!**/*.auto.*",
      "!!**/generated",
      "!!**/auto-generated",
      "!!**/codegen",
      "!!**/__generated__",
      "!!**/graphql-types.*",
      "!!**/schema.d.ts",
      "!!**/schema.graphql.d.ts",
      "!!**/*.d.ts.map",
      "!!**/.expo",
      "!!**/.expo-shared",
      "!!**/android/build",
      "!!**/ios/build",
      "!!**/DerivedData/**/*"
    ]
  },
  "formatter": {
    "enabled": true,
    "formatWithErrors": true,
    "indentStyle": "space",
    "indentWidth": 2,
    "lineEnding": "lf",
    "lineWidth": 80,
    "attributePosition": "auto",
    "bracketSpacing": true
  },
  "assist": {
    "actions": {
      "source": {
        // Provides a code action to sort the imports and exports in the file using a built-in or custom order.
        "organizeImports": "on",
        // Enforce attribute sorting in JSX elements.
        "useSortedAttributes": "on",
        // Enforce ordering of a JS object properties.
        "useSortedKeys": "off"
      }
    }
  },
  "linter": {
    "enabled": true,
    "rules": {
      "a11y": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noAccessKey": "error",
        "noAriaHiddenOnFocusable": "error",
        "noAriaUnsupportedElements": "error",
        "noDistractingElements": "error",
        "noHeaderScope": "error",
        "noInteractiveElementToNoninteractiveRole": "error",
        "noLabelWithoutControl": "error",
        "noNoninteractiveElementInteractions": "error",
        "noNoninteractiveElementToInteractiveRole": "error",
        "noNoninteractiveTabindex": "error",
        "noPositiveTabindex": "error",
        "noRedundantAlt": "error",
        "noRedundantRoles": "error",
        "noStaticElementInteractions": "error",
        "noSvgWithoutTitle": "error",
        "useAltText": "error",
        "useAnchorContent": "error",
        "useAriaActivedescendantWithTabindex": "error",
        "useAriaPropsForRole": "error",
        "useAriaPropsSupportedByRole": "error",
        "useButtonType": "error",
        "useFocusableInteractive": "error",
        "useHeadingContent": "error",
        "useHtmlLang": "error",
        "useIframeTitle": "error",
        "useKeyWithClickEvents": "error",
        "useKeyWithMouseEvents": "error",
        "useMediaCaption": "error",
        "useSemanticElements": "error",
        "useValidAnchor": "error",
        "useValidAriaProps": "error",
        "useValidAriaRole": "error",
        "useValidAriaValues": "error",
        "useValidAutocomplete": "error",
        "useValidLang": "error",

        "noAutofocus": "off",

        /** ------------------------ CSS Rules ------------------------ **/
        "useGenericFontNames": "error"
      },
      "complexity": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noAdjacentSpacesInRegex": "error",
        "noArguments": "error",
        "noBannedTypes": "error",
        "noCommaOperator": "error",
        "noEmptyTypeParameters": "error",
        "noExcessiveCognitiveComplexity": {
          "level": "error",
          "options": {
            "maxAllowedComplexity": 20
          }
        },
        "noExcessiveNestedTestSuites": "error",
        "noExtraBooleanCast": "error",
        "noFlatMapIdentity": "error",
        "noForEach": "error",
        "noStaticOnlyClass": "error",
        "noThisInStatic": "error",
        "noUselessCatch": "error",
        "noUselessConstructor": "error",
        "noUselessContinue": "error",
        "noUselessEmptyExport": "error",
        "noUselessEscapeInRegex": "error",
        "noUselessFragments": "error",
        "noUselessLabel": "error",
        "noUselessLoneBlockStatements": "error",
        "noUselessRename": "error",
        "noUselessStringConcat": "error",
        "noUselessStringRaw": "error",
        "noUselessSwitchCase": "error",
        "noUselessTernary": "error",
        "noUselessThisAlias": "error",
        "noUselessTypeConstraint": "error",
        "noUselessUndefinedInitialization": "error",
        "noVoid": "error",
        "useArrowFunction": "error",
        "useDateNow": "error",
        "useFlatMap": "error",
        "useIndexOf": "error",
        "useLiteralKeys": "error",
        "useNumericLiterals": "error",
        "useOptionalChain": "error",
        "useRegexLiterals": "error",
        "useSimpleNumberKeys": "error",
        "useSimplifiedLogicExpression": "error",
        "useWhile": "error",

        "noExcessiveLinesPerFunction": "off",
        "noImplicitCoercions": "off",

        /** ------------------------ CSS Rules ------------------------ **/
        "noImportantStyles": "off"
      },
      "correctness": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noConstantCondition": "error",
        "noConstantMathMinMaxClamp": "error",
        "noConstAssign": "error",
        "noConstructorReturn": "error",
        "noEmptyCharacterClassInRegex": "error",
        "noEmptyPattern": "error",
        "noGlobalDirnameFilename": "error",
        "noGlobalObjectCalls": "error",
        "noInnerDeclarations": "error",
        "noInvalidBuiltinInstantiation": "error",
        "noInvalidConstructorSuper": "error",
        "noInvalidUseBeforeDeclaration": "error",
        "noNonoctalDecimalEscape": "error",
        "noPrecisionLoss": "error",
        "noRestrictedElements": "error",
        "noSelfAssign": "error",
        "noSetterReturn": "error",
        "noStringCaseMismatch": "error",
        "noSwitchDeclarations": "error",
        "noUndeclaredVariables": "error",
        "noUnreachable": "error",
        "noUnreachableSuper": "error",
        "noUnsafeFinally": "error",
        "noUnsafeOptionalChaining": "error",
        "noUnusedFunctionParameters": "error",
        "noUnusedImports": {
          "fix": "safe",
          "level": "error"
        },
        "noUnusedLabels": "error",
        "noUnusedPrivateClassMembers": "error",
        "noUnusedVariables": "error",
        "noVoidTypeReturn": "error",
        "useGraphqlNamedOperations": "error",
        "useImageSize": "error",
        "useIsNan": "error",
        "useParseIntRadix": "error",
        "useSingleJsDocAsterisk": "error",
        "useValidForDirection": "error",
        "useValidTypeof": "error",
        "useYield": "error",

        "noNodejsModules": "off",
        "noProcessGlobal": "off",
        "useUniqueElementIds": "off",

        /** ------ Project rules use Scanner and are too slow (https://biomejs.dev/linter/domains/#project-rules) ------ **/
        "noPrivateImports": "off",
        "noUndeclaredDependencies": "off",
        "useImportExtensions": "off",
        "useJsonImportAttributes": "off",

        /** ------------------------ CSS Rules ------------------------ **/
        "noInvalidDirectionInLinearGradient": "error",
        "noInvalidGridAreas": "error",
        "noInvalidPositionAtImportRule": "error",
        "noMissingVarFunction": "error",
        "noUnknownFunction": "error",
        "noUnknownMediaFeatureName": "error",
        "noUnknownProperty": "error",
        "noUnknownPseudoClass": "error",
        "noUnknownPseudoElement": "error",
        "noUnknownTypeSelector": "error",
        "noUnknownUnit": "error",
        "noUnmatchableAnbSelector": "error"
      },
      "nursery": {
        // Typically we don't enable nursery rules anymore (https://github.com/haydenbleasel/ultracite/issues/457)
        // but this was requested specifically by a lot of people.
        "useSortedClasses": {
          "fix": "safe",
          "level": "error",
          "options": {
            "attributes": ["className"],
            "functions": ["clsx", "cva", "tw", "twMerge", "cn", "twJoin", "tv"]
          }
        }
      },
      "performance": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noAccumulatingSpread": "error",
        "noBarrelFile": "error",
        "noDelete": "error",
        "noDynamicNamespaceImportAccess": "error",
        "noNamespaceImport": "error",
        "noUnwantedPolyfillio": "error",
        "useGoogleFontPreconnect": "error",
        "useTopLevelRegex": "error",

        "noAwaitInLoops": "off",
        "noReExportAll": "off"
      },
      "security": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noBlankTarget": "error",
        "noDangerouslySetInnerHtml": "error",
        "noDangerouslySetInnerHtmlWithChildren": "error",
        "noGlobalEval": "error",

        "noSecrets": "off"
      },
      "style": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noDoneCallback": "error",
        "noEnum": "error",
        "noExportedImports": "error",
        "noInferrableTypes": "error",
        "noNamespace": "error",
        "noNegationElse": "error",
        "noNestedTernary": "error",
        "noNonNullAssertion": "error",
        "noParameterAssign": "error",
        "noParameterProperties": "error",
        "noRestrictedGlobals": "error",
        "noRestrictedImports": "error",
        "noRestrictedTypes": "error",
        "noShoutyConstants": "error",
        "noSubstr": "error",
        "noUnusedTemplateLiteral": "error",
        "noUselessElse": "error",
        "noYodaExpression": "error",
        "useArrayLiterals": "error",
        "useAsConstAssertion": "error",
        "useAtIndex": "error",
        "useBlockStatements": "error",
        "useCollapsedElseIf": "error",
        "useCollapsedIf": "error",
        "useConsistentArrayType": "error",
        "useConsistentBuiltinInstantiation": "error",
        "useConsistentMemberAccessibility": "error",
        "useConsistentObjectDefinitions": "error",
        "useConsistentTypeDefinitions": {
          "level": "error",
          "options": {
            "style": "interface"
          }
        },
        "useConst": "error",
        "useDefaultParameterLast": "error",
        "useDefaultSwitchClause": "error",
        "useDeprecatedReason": "error",
        "useEnumInitializers": "error",
        "useExponentiationOperator": "error",
        "useExportType": "error",
        "useFilenamingConvention": {
          "level": "error",
          "options": {
            "requireAscii": true,
            "filenameCases": ["kebab-case"]
          }
        },
        "useForOf": "error",
        "useFragmentSyntax": "error",
        "useGraphqlNamingConvention": "error",
        "useGroupedAccessorPairs": "error",
        "useImportType": "error",
        "useLiteralEnumMembers": "error",
        "useNodeAssertStrict": "error",
        "useNodejsImportProtocol": "error",
        "useNumberNamespace": "error",
        "useNumericSeparators": "error",
        "useObjectSpread": "error",
        "useReadonlyClassProperties": "error",
        "useSelfClosingElements": "error",
        "useShorthandAssign": "error",
        "useShorthandFunctionType": "error",
        "useSymbolDescription": "error",
        "useTemplate": "error",
        "useThrowNewError": "error",
        "useThrowOnlyError": "error",
        "useTrimStartEnd": "error",
        "useUnifiedTypeSignatures": "error",

        "noCommonJs": "off",
        "noDefaultExport": "off",
        "noImplicitBoolean": "off",
        "noMagicNumbers": "off",
        "noProcessEnv": "off",
        "useComponentExportOnlyModules": "off",
        "useConsistentCurlyBraces": "off",
        "useExplicitLengthCheck": "off",
        "useExportsLast": "off",
        "useNamingConvention": "off",
        "useSingleVarDeclarator": "off",

        /** ------------------------ CSS Rules ------------------------ **/
        "noDescendingSpecificity": "error",
        "noValueAtRule": "error"
      },
      "suspicious": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noAlert": "error",
        "noApproximativeNumericConstant": "error",
        "noAssignInExpressions": "error",
        "noAsyncPromiseExecutor": "error",
        "noBiomeFirstException": "error",
        "noBitwiseOperators": "error",
        "noCatchAssign": "error",
        "noClassAssign": "error",
        "noCommentText": "error",
        "noCompareNegZero": "error",
        "noConfusingLabels": "error",
        "noConfusingVoidType": "error",
        "noConstantBinaryExpressions": "error",
        "noConstEnum": "error",
        "noControlCharactersInRegex": "error",
        "noDebugger": "error",
        "noDocumentCookie": "error",
        "noDoubleEquals": "error",
        "noDuplicateCase": "error",
        "noDuplicateClassMembers": "error",
        "noDuplicateElseIf": "error",
        "noDuplicateFields": "error",
        "noDuplicateObjectKeys": "error",
        "noDuplicateParameters": "error",
        "noDuplicateTestHooks": "error",
        "noEmptyBlockStatements": "error",
        "noEmptyInterface": "error",
        "noEvolvingTypes": "error",
        "noExplicitAny": "error",
        "noExportsInTest": "error",
        "noExtraNonNullAssertion": "error",
        "noFallthroughSwitchClause": "error",
        "noFocusedTests": "error",
        "noFunctionAssign": "error",
        "noGlobalAssign": "error",
        "noGlobalIsFinite": "error",
        "noGlobalIsNan": "error",
        "noImplicitAnyLet": "error",
        "noImportAssign": "error",
        "noIrregularWhitespace": "error",
        "noLabelVar": "error",
        "noMisleadingCharacterClass": "error",
        "noMisleadingInstantiator": "error",
        "noMisplacedAssertion": "error",
        "noMisrefactoredShorthandAssign": "error",
        "noOctalEscape": "error",
        "noPrototypeBuiltins": "error",
        "noQuickfixBiome": "error",
        "noRedeclare": "error",
        "noRedundantUseStrict": "error",
        "noSelfCompare": "error",
        "noShadowRestrictedNames": "error",
        "noSkippedTests": "error",
        "noSparseArray": "error",
        "noTemplateCurlyInString": "error",
        "noThenProperty": "error",
        "noTsIgnore": "error",
        "noUnassignedVariables": "error",
        "noUnsafeDeclarationMerging": "error",
        "noUnsafeNegation": "error",
        "noUselessEscapeInString": "error",
        "noUselessRegexBackrefs": "error",
        "noVar": "error",
        "noWith": "error",
        "useAdjacentOverloadSignatures": "error",
        "useAwait": "error",
        "useBiomeIgnoreFolder": "error",
        "useDefaultSwitchClauseLast": "error",
        "useErrorMessage": "error",
        "useGetterReturn": "error",
        "useGoogleFontDisplay": "error",
        "useGuardForIn": "error",
        "useIsArray": "error",
        "useIterableCallbackReturn": "error",
        "useNamespaceKeyword": "error",
        "useNumberToFixedDigitsArgument": "error",
        "useStaticResponseMethods": "error",
        "useStrictMode": "error",
        "noNonNullAssertedOptionalChain": "error",

        "noConsole": "off",

        /** ------------------------ CSS Rules ------------------------ **/
        "noDuplicateAtImportRules": "error",
        "noDuplicateCustomProperties": "error",
        "noDuplicateFontNames": "error",
        "noDuplicateProperties": "error",
        "noDuplicateSelectorsKeyframeBlock": "error",
        "noEmptyBlock": "error",
        "noImportantInKeyframe": "error",
        "noShorthandPropertyOverrides": "error",
        "noUnknownAtRules": "error"
      }
    }
  },
  "javascript": {
    "formatter": {
      "arrowParentheses": "always",
      "bracketSameLine": false,
      "jsxQuoteStyle": "double",
      "quoteProperties": "asNeeded",
      "semicolons": "always",
      "trailingCommas": "es5"
    }
  },
  "css": {
    "formatter": {
      "enabled": true,
      "lineEnding": "lf",
      "lineWidth": 80,
      "quoteStyle": "double"
    },
    "parser": {
      "allowWrongLineComments": false,
      "cssModules": false,
      "tailwindDirectives": true
    }
  },
  "json": {
    "assist": {
      "enabled": false
    },
    "formatter": {
      "enabled": true,
      "indentStyle": "space",
      "indentWidth": 2,
      "lineEnding": "lf",
      "lineWidth": 80,
      "trailingCommas": "none"
    },
    "parser": {
      "allowComments": false,
      "allowTrailingCommas": false
    }
  },
  "html": {
    "formatter": {
      "enabled": true
    }
  },
  "vcs": {
    "enabled": true,
    "clientKind": "git",
    "useIgnoreFile": true,
    "defaultBranch": "main"
  },
  "overrides": [
    {
      // Configuration files that often need default exports
      "includes": [
        "*.config.{js,ts,mjs,cjs,mts,cts}",
        "vite.config.*",
        "vitest.config.*",
        "jest.config.*",
        "rollup.config.*",
        "webpack.config.*",
        "eslint.config.*",
        "prettier.config.*",
        "stylelint.config.*",
        "commitlint.config.*",
        "lint-staged.config.*",
        "postcss.config.*",
        "tailwind.config.*",
        "playwright.config.*",
        "cypress.config.*",
        "babel.config.*",
        "metro.config.*",
        "next.config.*",
        "nuxt.config.*",
        "astro.config.*",
        "svelte.config.*",
        "tsup.config.*"
      ]
    },
    {
      // Test files
      "includes": ["**/*.{test,spec}.{ts,tsx,js,jsx}", "**/__tests__/**/*"],
      "linter": {
        "rules": {
          "complexity": {
            "noExcessiveCognitiveComplexity": "off"
          },
          "suspicious": {
            "noConsole": "off",
            "noExplicitAny": "off"
          }
        }
      }
    },
    {
      // Scripts and CLI tools
      "includes": ["**/scripts", "**/bin", "*.mjs", "*.cjs"],
      "linter": {
        "rules": {
          "suspicious": {
            "noConsole": "off"
          },
          "style": {
            "noProcessEnv": "off"
          }
        }
      }
    },
    {
      // Storybook files
      "includes": ["**/*.{stories,story}.{ts,tsx,js,jsx}"],
      "linter": {
        "rules": {
          "correctness": {
            "noUnusedVariables": "off",
            "noUnusedImports": "off"
          }
        }
      }
    },
    {
      // Environment and type definition files
      "includes": ["**/*.d.ts", "**/{env,global,types}.d.ts"],
      "linter": {
        "rules": {
          "correctness": {
            "noUnusedVariables": "off",
            "noUndeclaredVariables": "off"
          }
        }
      }
    },
    {
      // Files that should not be processed (build output, generated files, non-JS files)
      "includes": [
        "**/dist",
        "**/build",
        "**/.next",
        "**/.nuxt",
        "**/out",
        "**/coverage",
        "**/*.min.js",
        "**/*.min.css",
        "**/worker-configuration.d.ts",
        ".env",
        ".env.*"
      ],
      "formatter": {
        "enabled": false
      },
      "linter": {
        "enabled": false
      }
    },
    {
      // Package.json and similar JSON config files
      "includes": [
        "**/package.json",
        "**/{tsconfig,jsconfig}.json",
        "**/tsconfig.*.json",
        ".vscode/*.json",
        ".github/**/*.json"
      ],
      "json": {
        "parser": {
          "allowComments": true,
          "allowTrailingCommas": true
        }
      }
    },
    {
      // JSONC files (JSON with Comments)
      "includes": ["**/*.jsonc"],
      "json": {
        "parser": {
          "allowComments": true,
          "allowTrailingCommas": true
        }
      }
    }
  ]
}
