Skip to content

chore(mosaic): add code quality and CSS lint rules - #10450

Closed
austincalvelage wants to merge 8 commits into
mainfrom
austin/linting-mosaic-quality
Closed

austincalvelage wants to merge 8 commits into
mainfrom
austin/linting-mosaic-quality

Conversation

@austincalvelage

@austincalvelage austincalvelage commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Description

Adds ESLint policies scoped to Mosaic, split into rule-specific commits. Reuses the existing TypeScript ESLint and StyleX libraries without adding dependencies, and keeps the current React 18 and React 19 contract and hooks plugin unchanged.

Rule Level What it checks
@typescript-eslint/consistent-type-assertions Existing error Mosaic already prohibits non-const assertions. This also covers assertion chains and widening followed by an assertion, so no custom rules are needed for those cases.
@typescript-eslint/no-unnecessary-condition Warning Conditions that cannot change the result according to their types. Limited to internal utils and machine code.
good-css/explicit-transition-properties Error transition: all and shorthand transitions that implicitly target every property. Standalone duration atoms remain valid for style composition.
good-css/reduced-motion Error Movement transitions without a recognized no-preference guard or reduced-motion override that removes the movement or sets its duration to zero.
good-css/preserve-focus-outline Error Explicit outline removal in focus branches without a recognized outline replacement or forced-colors restoration.
@stylexjs/valid-styles with propLimits Error Rejects marginTop, marginBottom, paddingTop, and paddingBottom, with messages pointing to their logical block-axis equivalents.

The new implementation checks exclude tests. The CSS checks inspect authored StyleX declarations in *.styles.ts, including conditional values, local constant media-query keys, and simple dynamic style functions. They do not inspect arbitrary objects or consumer styles.

Only the three transition, reduced-motion, and focus checks remain local. They need StyleX-specific conditional context that the installed library rules do not provide. Accumulator-copying enforcement is omitted because there is no equivalent rule in the existing dependencies.

Replaces the 11 existing physical-spacing declarations with marginBlockStart, paddingBlockStart, or paddingBlockEnd. All values stay unchanged, preserving the horizontal layout in both LTR and RTL. Existing assertion exceptions stay under Mosaic's established suppression policy.

Checklist

  • Relevant tests pass: 127 ESLint tests and 43 Mosaic component tests.
  • Mosaic lint and the affected styles pass; all 11 spacing warnings are resolved.
  • Mosaic CSS build passes with pnpm --filter @clerk/mosaic build:css.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other: Mosaic lint policy

@changeset-bot

changeset-bot Bot commented Oct 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 27d8e6c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@clerk/mosaic Patch
@clerk/swingset Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
clerk-js-sandbox Ready Ready Preview Oct 27, 2026 5:00am UTC
swingset Ready Ready Preview Oct 27, 2026 5:00am UTC

Request Review

@pkg-pr-new

pkg-pr-new Bot commented Oct 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@10450

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@10450

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@10450

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@10450

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@10450

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@10450

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@10450

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@10450

@clerk/expo-biometrics

npm i https://pkg.pr.new/@clerk/expo-biometrics@10450

@clerk/expo-google-signin

npm i https://pkg.pr.new/@clerk/expo-google-signin@10450

@clerk/expo-native-components

npm i https://pkg.pr.new/@clerk/expo-native-components@10450

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@10450

@clerk/express

npm i https://pkg.pr.new/@clerk/express@10450

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@10450

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@10450

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@10450

@clerk/mosaic

npm i https://pkg.pr.new/@clerk/mosaic@10450

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@10450

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@10450

@clerk/react

npm i https://pkg.pr.new/@clerk/react@10450

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@10450

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@10450

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@10450

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@10450

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@10450

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@10450

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@10450

commit: 27d8e6c

This branch was successfully deployed

2 active deployments
Preview – swingset — 27d8e6cf Deployed Oct 27, 2026 by vercel[bot]
Preview – clerk-js-sandbox — 27d8e6cf Deployed Oct 27, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant