feat: add rules to ensure Tailwind CSS is used properly
Adds the tailwind
and vue-tailwind
rules to ensure we are using
Tailwind CSS properly across our codebases. At the moment, this prevents
utility class names from being built using string interpolation which
would confuse Tailwind's parser. In the future, this will be extended to
disallow some features that might cause the CSS bundle size from growing
out of control.
Screenshots
Offences in Js code |
---|
Offence in Vue template |
---|
Offence in Vue template |
---|
How to test this locally?
- Install
yalc
if you haven't already: https://github.com/wclr/yalc - Checkout this branch and publish it with
yalc
:yalc publish
- In your GitLab repo or any other consumer you'd like to test this in, install the published development package:
yalc add @gitlab/eslint-plugin
- In the project's
.eslintrc
, configure to rules to error out when offences are detected:'@gitlab/tailwind': error '@gitlab/vue-tailwind': error
Edited by Paul Gascou-Vaillancourt