jakala-na / next-contentful-starterkit

https://next-contentful-starterkit.vercel.app/
MIT License
2 stars 0 forks source link

Add tailwind eslint plugin and good default that prevent common tailwind bugs #40

Open asgorobets opened 4 months ago

asgorobets commented 4 months ago

Add https://www.npmjs.com/package/eslint-plugin-tailwindcss

Example of config can be found in Orbitkit https://github.com/ixahmedxi/orbitkit/blob/main/packages/config/eslint/src/configs/base.js

But it just uses plugin:tailwindcss/recommended default

It's important to whitelist cn function (our helper for clsx and tailwind-merge) so that we validate classnames in the helper

Ideally a good test is using a text-undefinedcolor class. It should warn you or even fail if this color does not exist.