Skip to content

chore(monorepo): 🤖 make linting, formatting centralized#955

Open
punkbit wants to merge 27 commits intochore/design-tokens-packagefrom
chore/monorepo-make-linting-formatting-centralized
Open

chore(monorepo): 🤖 make linting, formatting centralized#955
punkbit wants to merge 27 commits intochore/design-tokens-packagefrom
chore/monorepo-make-linting-formatting-centralized

Conversation

@punkbit
Copy link
Copy Markdown
Collaborator

@punkbit punkbit commented Mar 27, 2026

Why?

A single root-level config ensures all packages use identical formatting rules from one source of truth making maintenance simpler (one file to update), avoiding style drift between packages formatting and linting rules.

How?

  • Create root-level config for eslint and prettier
  • Point eslint and prettier commands to use root configuration files

Tickets?

N/A

Contribution checklist?

  • You've done enough research before writing
  • You have reviewed the PR
  • The commit messages are detailed
  • The build command runs locally
  • Assets or static content are linked and stored in the project
  • For documentation, guides or references, you've tested the commands

Security checklist?

  • All user inputs are validated and sanitized
  • No usage of dangerouslySetInnerHTML
  • Sensitive data has been identified and is being protected properly
  • Build output contains no secrets or API keys

Preview?

❯ yarn format
[@clickhouse/click-ui]: Process started
[@clickhouse/click-ui]: Checking formatting...
[@clickhouse/click-ui]: All matched files use Prettier code style!
[@clickhouse/click-ui]: Process exited (exit code 0), completed in 2s 67ms

[@clickhouse/design-tokens]: Process started
[@clickhouse/design-tokens]: Checking formatting...
[@clickhouse/design-tokens]: All matched files use Prettier code style!
[@clickhouse/design-tokens]: Process exited (exit code 0), completed in 0s 283ms
Done in 2s 352ms
On branch chore/monorepo-make-linting-formatting-centralized
nothing to commit, working tree clean

click-ui on 🌱 chore/monorepo-make-linting-form [📦] via  v23.9.0 on   (
❯ git push origin chore/monorepo-make-linting-formatting-centralized
Enumerating objects: 39, done.
Counting objects: 100% (39/39), done.
Delta compression using up to 12 threads
Compressing objects: 100% (20/20), done.
Writing objects: 100% (21/21), 4.74 KiB | 2.37 MiB/s, done.
Total 21 (delta 14), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (14/14), completed with 14 local objects.
remote:
remote: Create a pull request for 'chore/monorepo-make-linting-formatting-
remote:      https://github.com/ClickHouse/click-ui/pull/new/chore/monorep
remote:
remote: GitHub found 22 vulnerabilities on ClickHouse/click-ui's default b
remote:      https://github.com/ClickHouse/click-ui/security/dependabot
remote:
To github.com:ClickHouse/click-ui.git
 * [new branch]        chore/monorepo-make-linting-formatting-centralized

click-ui on 🌱 chore/monorepo-make-linting-form [📦] via  v23.9.0 on   (
❯ yarn format
[@clickhouse/click-ui]: Process started
[@clickhouse/click-ui]: Checking formatting...
[@clickhouse/click-ui]: All matched files use Prettier code style!
[@clickhouse/click-ui]: Process exited (exit code 0), completed in 2s 67ms

[@clickhouse/design-tokens]: Process started
[@clickhouse/design-tokens]: Checking formatting...
[@clickhouse/design-tokens]: All matched files use Prettier code style!
[@clickhouse/design-tokens]: Process exited (exit code 0), completed in 0s
Done in 2s 352ms

click-ui on 🌱 chore/monorepo-make-linting-form [📦] via  v23.9.0 on   (
❯ yarn lint
[@clickhouse/click-ui]: Process started
[@clickhouse/click-ui]:
...
[@clickhouse/click-ui]:
[@clickhouse/click-ui]: Process exited (exit code 0), completed in 15s 481ms

[@clickhouse/design-tokens]: Process started
[@clickhouse/design-tokens]: ✔  No errors 261ms
[@clickhouse/design-tokens]: Process exited (exit code 0), completed in 0s 818ms
Done in 16s 301ms

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 27, 2026

⚠️ No Changeset found

Latest commit: 65210ea

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

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

@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@ClickHouse ClickHouse deleted a comment from github-actions bot Mar 27, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 27, 2026

Claude finished @punkbit's task in 1m 22s —— View job


PR Review: chore(monorepo): make linting, formatting centralized

  • Gathering context
  • Reading changed files
  • Providing review feedback

Nice work on this! The approach of exporting named constants from the root eslint.config.ts (rather than a default export) is the right pattern for monorepo ESLint sharing — it lets packages compose selectively. The tsconfig hierarchy is clean too. A couple of things worth a look:

💡 Suggestions (non-blocking)

  • prettier version pinning driftpackages/click-ui/package.json previously pinned prettier at exact 3.7.4; the root now uses ^3.7.4 (package.json:32). If reproducibility matters (it usually does for a published component lib), consider keeping it exact: "prettier": "3.7.4".

  • Format coverage narrowed — The deleted .scripts/bash/format (23 lines) was replaced by "src/**/*.{js,jsx,ts,tsx}" in the format script (packages/click-ui/package.json:374). Config files like eslint.config.ts, vite.config.ts, .storybook/**/*.{ts,tsx} are no longer checked by yarn format. This may be intentional, but worth confirming no config files have drifted.

  • design-tokens format now checks . (all files)packages/design-tokens/package.json:28 uses prettier --check . which will pick up tsconfig.json, terrazzo.config.ts, etc. This is broader than before. The .prettierignore at root covers dist/node_modules/.yarn, so it's probably fine — just intentional to make explicit.

  • Root tsconfig.eslint.json excludes packages/design-tokens (tsconfig.eslint.json:9) — makes sense since design-tokens uses Terrazzo's linter, and it's well-documented in the root eslint.config.ts comment. Worth adding a matching note in tsconfig.eslint.json for future maintainers.

  • @typescript-eslint/eslint-plugin moved to root but typescript-eslint (the typed wrapper) is also in root — these are now both root deps. ESLint resolves plugins from the config file location, so with jiti loading eslint.config.ts from root, this should be fine. If CI passes, you're good.


✅ The core goal is solid — one source of truth for formatting/linting, clean composition at the package level, and correct exclusion of design-tokens from ESLint. The PR works as described. The points above are all minor hygiene items, not blockers.

@workflow-authentication-public
Copy link
Copy Markdown
Contributor

📚 Storybook Preview Deployed

✅ Preview URL: https://click-d6ftuf34c-clickhouse.vercel.app

Built from commit: 8a4fd0543557dd3f2aed103c34b0fae679424cd5

@punkbit punkbit marked this pull request as ready for review March 27, 2026 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant