{
  "root": false,
  "$schema": "../../../node_modules/@biomejs/biome/configuration_schema.json",
  "files": {
    "ignoreUnknown": true,
    // Populated by scripts/generate-dts.ts from config/shared/ignores.mjs.
    // Inlined (rather than extended from a separate jsonc file) so the !!
    // globs survive merge when consumers define their own files.includes —
    // see issue #679.
    "includes": [
      "**",
      "!!**/node_modules",
      "!!**/.git",
      "!!**/dist",
      "!!**/build",
      "!!**/out",
      "!!**/.next",
      "!!**/.open-next",
      "!!**/.nuxt",
      "!!**/.output",
      "!!**/.svelte-kit",
      "!!**/.vitepress/cache",
      "!!**/.vitepress/dist",
      "!!**/.turbo",
      "!!**/.vercel",
      "!!**/.netlify",
      "!!**/.wrangler",
      "!!**/.wrangler-dry-run",
      "!!**/.docusaurus",
      "!!**/.cache",
      "!!**/.parcel-cache",
      "!!**/.vite",
      "!!**/.astro",
      "!!**/_astro",
      "!!**/public/build",
      "!!**/storybook-static",
      "!!**/_generated",
      "!!**/*.gen.*",
      "!!**/*.generated.*",
      "!!**/*.auto.*",
      "!!**/generated",
      "!!**/auto-generated",
      "!!**/codegen",
      "!!**/__generated__",
      "!!**/graphql-types.*",
      "!!**/schema.d.ts",
      "!!**/schema.graphql.d.ts",
      "!!**/*.d.ts.map",
      "!!**/.yarn",
      "!!**/coverage",
      "!!**/.nyc_output",
      "!!**/.expo",
      "!!**/.expo-shared",
      "!!**/android/build",
      "!!**/ios/build",
      "!!**/DerivedData/**/*",
      "!!**/bun.lock",
      "!!**/bun.lockb",
      "!!**/package-lock.json",
      "!!**/yarn.lock",
      "!!**/pnpm-lock.yaml",
      "!!**/next-env.d.ts",
      "!!**/worker-configuration.d.ts"
    ]
  },
  "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. Matches sort-keys in
        // the oxlint/ESLint configs.
        "useSortedKeys": "on",
        // Enforce ordering of TypeScript enum members. Off because reordering
        // members changes the implicit numeric values of the enum.
        "useSortedEnumMembers": "off",
        // Enforce no duplicate classes in the file.
        "noDuplicateClasses": "on",
        // Enforce ordering of a TypeScript interface members.
        "useSortedInterfaceMembers": "on",
        // Enforce ordering of a JavaScript object properties.
        "useSortedProperties": "on",
        // Enforce ordering of TypeScript type alias members.
        "useSortedTypeFields": "on",
        // Enforce alphabetical ordering of GraphQL selection sets.
        "useSortedSelectionSet": "on",
        // Enforce ordering of package.json keys.
        "useSortedPackageJson": "on"
      }
    }
  },
  "linter": {
    "enabled": true,
    "rules": {
      "a11y": {
        /** ------------------------ JavaScript Rules ------------------------ **/

        "noAccessKey": "error",
        "noAmbiguousAnchorText": "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",
        "noDivRegex": "error",
        "noEmptyTypeParameters": "error",
        "noExcessiveCognitiveComplexity": {
          "level": "error",
          "options": {
            "maxAllowedComplexity": 20
          }
        },
        "noExtraBooleanCast": "error",
        "noFlatMapIdentity": "error",
        "noForEach": "error",
        "noRedundantDefaultExport": "error",
        "noStaticOnlyClass": "error",
        "noThisInStatic": "error",
        "noUselessCatch": "error",
        "noUselessCatchBinding": "error",
        "noUselessConstructor": "error",
        "noUselessContinue": "error",
        "noUselessEmptyExport": "error",
        "noUselessEscapeInRegex": "error",
        "noUselessFragments": "error",
        "noUselessLabel": "error",
        "noUselessLoneBlockStatements": "error",
        "noUselessRename": "error",
        "noUselessReturn": "error",
        "noUselessStringConcat": "error",
        "noUselessStringRaw": "error",
        "noUselessSwitchCase": "error",
        "noUselessTernary": "error",
        "noUselessThisAlias": "error",
        "noUselessTypeConstraint": "error",
        "noUselessUndefined": "error",
        "noUselessUndefinedInitialization": "error",
        "noVoid": "error",
        "useArrayFind": "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",
        "useMaxParams": "off",

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

        "noConstantCondition": "error",
        "noConstantMathMinMaxClamp": "error",
        "noConstAssign": "error",
        "noConstructorReturn": "error",
        "noDuplicateArgumentNames": "error",
        "noDuplicateAttributes": "error",
        "noDuplicateEnumValueNames": "error",
        "noDuplicateInputFieldNames": "error",
        "noDuplicateVariableNames": "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"
        },
        "noUnusedInstantiation": "error",
        "noUnusedLabels": "error",
        "noUnusedPrivateClassMembers": "error",
        "noUnusedVariables": "error",
        "noVoidTypeReturn": "error",
        "useGraphqlNamedOperations": "error",
        "useImageSize": "error",
        "useIsNan": "error",
        "useLoneAnonymousOperation": "error",
        "useParseIntRadix": "error",
        "useSingleJsDocAsterisk": "error",
        "useValidForDirection": "error",
        "useValidTypeof": "error",
        "useYield": "error",

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

        /** ------ Project/Scanner rules. Use ultracite/biome/type-aware to enable. ------ **/
        "noPrivateImports": "off",
        "noUndeclaredDependencies": "off",
        "noUnresolvedImports": "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",
        "noAwaitInLoops": "error",
        "noBarrelFile": "error",
        "noDelete": "error",
        "noDynamicNamespaceImportAccess": "error",
        "noJsxPropsBind": "error",
        "noNamespaceImport": "error",
        "noSyncScripts": "error",
        "noUnwantedPolyfillio": "error",
        "useGoogleFontPreconnect": "error",
        "useTopLevelRegex": "error",

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

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

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

        "noEnum": "error",
        "noExportedImports": "error",
        // Matches no-plusplus in the oxlint/ESLint configs.
        "noIncrementDecrement": "error",
        "noInferrableTypes": "error",
        "noMultiAssign": "error",
        "noMultilineString": "error",
        "noNamespace": "error",
        "noNegationElse": "error",
        "noNestedTernary": "error",
        "noNonNullAssertion": "error",
        "noParameterAssign": "error",
        "noParameterProperties": "error",
        "noRestrictedGlobals": "error",
        "noRestrictedImports": "error",
        "noRestrictedTypes": "error",
        "noRootType": "error",
        "noShoutyConstants": "error",
        "noSubstr": "error",
        "noUnusedTemplateLiteral": "error",
        "noUselessElse": "error",
        "noYodaExpression": "error",
        "useArrayLiterals": "error",
        "useAsConstAssertion": "error",
        "useAtIndex": "error",
        "useBlockStatements": {
          "fix": "safe",
          "level": "error"
        },
        "useCollapsedElseIf": "error",
        "useCollapsedIf": "error",
        "useConsistentArrowReturn": "error",
        "useConsistentArrayType": "error",
        "useConsistentBuiltinInstantiation": "error",
        "useConsistentEnumValueType": "error",
        "useConsistentGraphqlDescriptions": "error",
        "useConsistentMemberAccessibility": "error",
        "useConsistentMethodSignatures": "error",
        "useConsistentObjectDefinitions": "error",
        "useConsistentTypeDefinitions": {
          "level": "error",
          "options": {
            "style": "interface"
          }
        },
        "useConst": "error",
        "useDefaultParameterLast": "error",
        "useDefaultSwitchClause": "error",
        "useDeprecatedReason": "error",
        "useDestructuring": "error",
        "useEnumInitializers": "error",
        "useErrorCause": "error",
        "useExponentiationOperator": "error",
        "useExportType": "error",
        "useFilenamingConvention": {
          "level": "error",
          "options": {
            "requireAscii": true,
            "filenameCases": ["kebab-case"]
          }
        },
        "useForOf": "error",
        "useFragmentSyntax": "error",
        "useGraphqlNamingConvention": "error",
        "useGroupedAccessorPairs": "error",
        "useImportType": "error",
        "useInputName": "error",
        "useLiteralEnumMembers": "error",
        "useLoneExecutableDefinition": "error",
        "useNodeAssertStrict": "error",
        "useNodejsImportProtocol": "error",
        "useNumberNamespace": "error",
        "useNumericSeparators": "error",
        "useObjectSpread": "error",
        "useReadonlyClassProperties": "error",
        "useSelfClosingElements": "error",
        "useShorthandAssign": "error",
        "useShorthandFunctionType": "error",
        "useSpreadOverApply": "error",
        "useSymbolDescription": "error",
        "useTemplate": "error",
        "useThrowNewError": "error",
        "useThrowOnlyError": "error",
        "useTrimStartEnd": "error",
        "useUnifiedTypeSignatures": "error",

        "noCommonJs": "off",
        "noContinue": "off",
        "noDefaultExport": "off",
        "noExcessiveClassesPerFile": "off",
        "noExcessiveLinesPerFile": "off",
        "noHexColors": "off",
        "noImplicitBoolean": "off",
        "noJsxLiterals": "off",
        // Matches unicorn/prefer-global-this being off in the oxlint config.
        "useGlobalThis": "off",
        "noMagicNumbers": "off",
        "noProcessEnv": "off",
        "noTernary": "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",
        "noDeprecatedMediaType": "error",
        "noDocumentCookie": "error",
        "noDoubleEquals": "error",
        "noDuplicateCase": "error",
        "noDuplicateClassMembers": "error",
        "noDuplicateDependencies": "error",
        "noDuplicatedSpreadProps": "error",
        "noDuplicateElseIf": "error",
        "noDuplicateEnumValues": "error",
        "noDuplicateFields": "error",
        "noDuplicateGraphqlOperationName": "error",
        "noDuplicateObjectKeys": "error",
        "noDuplicateParameters": "error",
        "noEmptyBlockStatements": "error",
        "noEmptyInterface": "error",
        "noEqualsToNull": "error",
        "noEvolvingTypes": "error",
        "noExplicitAny": "error",
        "noExtraNonNullAssertion": "error",
        "noFallthroughSwitchClause": "error",
        "noFunctionAssign": "error",
        "noGlobalAssign": "error",
        "noGlobalIsFinite": "error",
        "noGlobalIsNan": "error",
        "noImplicitAnyLet": "error",
        "noImportAssign": "error",
        "noIrregularWhitespace": "error",
        "noLabelVar": "error",
        "noMisleadingCharacterClass": "error",
        "noMisleadingInstantiator": "error",
        "noMisrefactoredShorthandAssign": "error",
        "noNestedPromises": "error",
        "noOctalEscape": "error",
        "noParametersOnlyUsedInRecursion": "error",
        "noProto": "error",
        "noPrototypeBuiltins": "error",
        "noQuickfixBiome": "error",
        "noRedeclare": "error",
        "noRedundantUseStrict": "error",
        "noReturnAssign": "error",
        "noSelfCompare": "error",
        "noShadow": "error",
        "noShadowRestrictedNames": "error",
        "noSparseArray": "error",
        "noTemplateCurlyInString": "error",
        "noThenProperty": "error",
        "noTsIgnore": "error",
        "noUnassignedVariables": "error",
        "noUnnecessaryConditions": "error",
        "noUnsafeDeclarationMerging": "error",
        "noUnsafeNegation": "error",
        "noUselessEscapeInString": "error",
        "noUselessRegexBackrefs": "error",
        "noVar": "error",
        "noWith": "error",
        "useAdjacentOverloadSignatures": "error",
        "useArraySortCompare": "error",
        "useAwait": "error",
        "useBiomeIgnoreFolder": "error",
        "useDefaultSwitchClauseLast": "error",
        "useErrorMessage": "error",
        "useGetterReturn": "error",
        "useGoogleFontDisplay": "error",
        "useGuardForIn": "error",
        "useIsArray": "error",
        "useIterableCallbackReturn": "error",
        "useNamespaceKeyword": "error",
        "useNumberToFixedDigitsArgument": "error",
        "useRequiredScripts": "error",
        "useStaticResponseMethods": "error",
        "useStrictMode": "error",
        "noNonNullAssertedOptionalChain": "error",
        "noUnusedExpressions": "error",

        "noConsole": "off",
        "noForIn": "off",
        "noUndeclaredEnvVars": "off",
        "useDeprecatedDate": "off",

        /** ------ Project/Scanner rules. Use ultracite/biome/type-aware to enable. ------ **/
        "noDeprecatedImports": "off",
        "noImportCycles": "off",

        /** ------------------------ CSS Rules ------------------------ **/
        "noDuplicateAtImportRules": "error",
        "noDuplicateCustomProperties": "error",
        "noDuplicateFontNames": "error",
        "noDuplicateProperties": "error",
        "noDuplicateSelectorsKeyframeBlock": "error",
        "noEmptyBlock": "error",
        "noImportantInKeyframe": "error",
        "noShorthandPropertyOverrides": "error",
        "noUnknownAtRules": "error",

        /** ------------------------ CSS Rules ------------------------ **/
        "noEmptySource": "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": {
      "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",
        "**/.open-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", ".github/**/*.json"],
      "json": {
        "parser": {
          "allowTrailingCommas": true
        }
      }
    },
    {
      // JSONC files (JSON with Comments) - tsconfig.json is technically JSONC
      "includes": [
        "**/*.jsonc",
        "**/{tsconfig,jsconfig}.json",
        "**/tsconfig.*.json",
        ".vscode/*.json"
      ],
      "json": {
        "parser": {
          "allowComments": true,
          "allowTrailingCommas": true
        }
      }
    }
  ]
}
