From cc5c753e309facfe5fa21c1349e3f38becbbb7cd Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Fri, 3 Feb 2023 07:27:08 +1000 Subject: [PATCH] [EC-1051] Add TailwindCSS linting rules (#4605) --- .eslintrc.json | 15 +++++++++-- .../login/login-with-device.component.html | 2 ++ .../register-form.component.html | 2 ++ .../trial-initiation.component.html | 1 + .../vertical-step-content.component.html | 1 + .../user-verification-prompt.component.html | 2 +- .../access-selector.component.html | 4 ++- .../app/settings/change-avatar.component.html | 6 +++-- .../tools/import-export/export.component.html | 6 +++-- .../file-password-prompt.component.html | 8 +++--- .../vault/app/vault/add-edit.component.html | 2 +- .../dialog/secret-dialog.component.html | 1 + .../components/src/table/table.component.html | 2 ++ package-lock.json | 27 +++++++++++++++++++ package.json | 1 + 15 files changed, 68 insertions(+), 12 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 1bd7b04f21..8bbf78df51 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -111,9 +111,20 @@ { "files": ["*.html"], "parser": "@angular-eslint/template-parser", - "plugins": ["@angular-eslint/template"], + "plugins": ["@angular-eslint/template", "tailwindcss"], "rules": { - "@angular-eslint/template/button-has-type": "error" + "@angular-eslint/template/button-has-type": "error", + "tailwindcss/no-custom-classname": [ + "error", + { + // uses negative lookahead to whitelist any class that doesn't start with "tw-" + // in other words: classnames that start with tw- must be valid TailwindCSS classes + "whitelist": ["(?!(tw)\\-).*"] + } + ], + "tailwindcss/enforces-negative-arbitrary-values": "error", + "tailwindcss/enforces-shorthand": "error", + "tailwindcss/no-contradicting-classname": "error" } }, { diff --git a/apps/web/src/app/accounts/login/login-with-device.component.html b/apps/web/src/app/accounts/login/login-with-device.component.html index 3e5f48d597..84598b11ff 100644 --- a/apps/web/src/app/accounts/login/login-with-device.component.html +++ b/apps/web/src/app/accounts/login/login-with-device.component.html @@ -1,3 +1,5 @@ + +
diff --git a/apps/web/src/app/accounts/register-form/register-form.component.html b/apps/web/src/app/accounts/register-form/register-form.component.html index 614fcbccda..c18635079e 100644 --- a/apps/web/src/app/accounts/register-form/register-form.component.html +++ b/apps/web/src/app/accounts/register-form/register-form.component.html @@ -1,3 +1,5 @@ + +
+

{{ "createAccount" | i18n }}

+