Skip to content

v0.7.0

Choose a tag to compare

@PerfectPan PerfectPan released this 07 Nov 04:15
· 11 commits to main since this release
3baf6b3

What changed

  • defineLint(config) in @perfectpan/lint-config/vite-plus merges a repository's lint config into the shared one: categories, options and rules merge key by key, plugins are added, and overrides apply after the shared ones and the opt-in checks. lint and fmt are unchanged.
  • Two opt-in checks, off unless given:
    • tailwind: { stylesheets: [{ entryPoint, files, excludeFiles }], literalValues }: eslint-plugin-better-tailwindcss rules for unknown, conflicting, duplicate, non-canonical and concatenated classes and stray whitespace, plus literal colours or lengths in arbitrary values. Needs the plugin (new optional peer, >=4.10.0).
    • shadcn: { ui, elements }: the listed elements and Radix primitives only inside the shadcn/ui files (@radix-ui/react-slot allowed everywhere), and react/no-multi-comp off in those files.
  • The rule rationale moved from the README to docs/decisions.md; overrides and path exemptions to docs/overrides.md.

What newly fails

Nothing, unless a repository turns an opt-in check on. With tailwind, arbitrary values such as text-[14px], bg-[#fff] or shadow-[0_1px_rgb(0_0_0/0.1)] fail; set literalValues: false while adding theme tokens. With shadcn, a listed element or a Radix import outside ui fails; list only elements whose shadcn/ui component is installed.

Impact

PerfectPan/agent-kit apps/website, which already runs the first five Tailwind rules: no-restricted-classes 43 hits in 20 files, no-concatenated-classes 3 hits (all in src/lib/utils.test.ts); shadcn with elements: ["button"] 0 hits.

Upgrade

Change #v0.6.1 to #v0.7.0 in the @perfectpan/lint-config dependency, then reinstall.