DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to block arbitrary Tailwind values in agent-written UI with Lint

Flag off-scale Tailwind values so agents use your theme's spacing, colors, and sizes instead.

Short answer: Run npm install -D @shadcn/lint eslint @typescript-eslint/parser in the project; then create eslint.config.mjs with the shadcn plugin and the rule "shadcn/no-arbitrary-values": "error", as shown in the React ESLint setup; run npx eslint . and confirm it reports any existing arbitrary values. All steps.

Who it is forA front-end developer whose coding agent keeps adding one-off pixel values like p-[13px] that break the design system.

The problemAgents often invent arbitrary Tailwind values. These pass review in isolation but drift the UI away from the theme.

The outcomeArbitrary values are reported as Lint errors, and the error points the agent back to values already in the theme.

What you need first

  • Node.js 20.19 or later
  • A Tailwind v4 project (shadcn/ui is not required)
  • ESLint 9.30 or later, or Oxlint 1.80 or later
  • A React, Vue, or Svelte project

Steps

  1. Run npm install -D @shadcn/lint eslint @typescript-eslint/parser in the project.
  2. Create eslint.config.mjs with the shadcn plugin and the rule "shadcn/no-arbitrary-values": "error", as shown in the React ESLint setup.
  3. Run npx eslint . and confirm it reports any existing arbitrary values.
  4. Fix the reported files or add the Lint command to package.json as the Lint script.

Prompt for your agent

Use the GitHub repo shadcn-ui/lint to set up the no-arbitrary-values rule in <project-path>. Follow the README ESLint setup for React, then run the lint command. Expected output: a list of arbitrary Tailwind values in the project, or zero errors. Verify that the rule reports a test class such as p-[13px] in one component file.

Caveat. The README says Oxlint reads only the script blocks of Vue and Svelte files, not their templates, so template classes need ESLint.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for shadcn-ui/lint and "Block arbitrary Tailwind values in agent-written UI"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer