diff --git a/.eslintrc.cjs b/.eslintrc.cjs index e829eaa1fa..51cc6e8330 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -5,6 +5,7 @@ module.exports = { 'eslint:recommended', 'plugin:import/typescript', 'plugin:compat/recommended', + 'plugin:tailwindcss/recommended', ], env: { @@ -61,6 +62,9 @@ module.exports = { 'URL', // core-js 'URLSearchParams', // core-js ], + tailwindcss: { + config: 'tailwind.config.cjs', + }, }, rules: { @@ -235,18 +239,7 @@ module.exports = { }, ], 'import/newline-after-import': 'error', - 'import/no-extraneous-dependencies': [ - 'error', - // { - // devDependencies: [ - // 'webpack/**', - // 'app/soapbox/test_setup.js', - // 'app/soapbox/test_helpers.js', - // 'app/**/__tests__/**', - // 'app/**/__mocks__/**', - // ], - // }, - ], + 'import/no-extraneous-dependencies': 'error', 'import/no-unresolved': 'error', 'import/no-webpack-loader-syntax': 'error', 'import/order': [ @@ -271,6 +264,9 @@ module.exports = { 'promise/catch-or-return': 'error', 'react-hooks/rules-of-hooks': 'error', + + 'tailwindcss/classnames-order': 'error', + 'tailwindcss/migration-from-tailwind-2': 'error', }, overrides: [ { diff --git a/app/soapbox/components/account-search.tsx b/app/soapbox/components/account-search.tsx index c519b0243a..a3d7fd1a62 100644 --- a/app/soapbox/components/account-search.tsx +++ b/app/soapbox/components/account-search.tsx @@ -72,7 +72,7 @@ const AccountSearch: React.FC = ({ onSelected, ...rest }) => {
= ({ account, disabled }) => { return ( ); }; @@ -147,7 +147,7 @@ const Account = ({ src={actionIcon} title={actionTitle} onClick={handleAction} - className='bg-transparent text-gray-600 dark:text-gray-600 hover:text-gray-700 dark:hover:text-gray-500' + className='bg-transparent text-gray-600 hover:text-gray-700 dark:text-gray-600 dark:hover:text-gray-500' iconClassName='w-4 h-4' /> ); @@ -193,7 +193,7 @@ const Account = ({ const LinkEl: any = withLinkToProfile ? Link : 'div'; return ( -
+
{emoji && ( )} -
+
{children}} diff --git a/app/soapbox/components/animated-number.tsx b/app/soapbox/components/animated-number.tsx index 0f6908fdee..e7dd824624 100644 --- a/app/soapbox/components/animated-number.tsx +++ b/app/soapbox/components/animated-number.tsx @@ -50,7 +50,7 @@ const AnimatedNumber: React.FC = ({ value, obfuscate }) => { return ( {items => ( - + {items.map(({ key, data, style }) => ( 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}>{obfuscate ? obfuscatedCount(data) : } ))} diff --git a/app/soapbox/components/announcements/emoji.tsx b/app/soapbox/components/announcements/emoji.tsx index 64266639d5..3628227dfe 100644 --- a/app/soapbox/components/announcements/emoji.tsx +++ b/app/soapbox/components/announcements/emoji.tsx @@ -24,7 +24,7 @@ const Emoji: React.FC = ({ emoji, emojiMap, hovered }) => { return ( {emoji} = ({ emoji, emojiMap, hovered }) => { return ( {shortCode} = ({ value, onChange, required }) const handleChange = (date: Date) => onChange(date ? new Date(date.getTime() - (date.getTimezoneOffset() * 60000)).toISOString().slice(0, 10) : ''); return ( -
+
{Component => ( - {icon && } + {icon && } {text} diff --git a/app/soapbox/components/error-boundary.tsx b/app/soapbox/components/error-boundary.tsx index 87f6d749dd..3a6b4ac0be 100644 --- a/app/soapbox/components/error-boundary.tsx +++ b/app/soapbox/components/error-boundary.tsx @@ -113,17 +113,17 @@ class ErrorBoundary extends React.PureComponent { const errorText = this.getErrorText(); return ( -
-
-
+
+
+
-
-

+
+

@@ -132,7 +132,7 @@ class ErrorBoundary extends React.PureComponent { defaultMessage="We're sorry for the interruption. If the problem persists, please reach out to our support team. You may also try to {clearCookies} (this will log you out)." values={{ clearCookies: ( - + {

- + @@ -158,11 +158,11 @@ class ErrorBoundary extends React.PureComponent {
{!isProduction && ( -
+
{errorText && (