From b856f15b22d9e2eb9cf8a43d3f7e72b69a78ef27 Mon Sep 17 00:00:00 2001 From: Utku <74243531+utkubakir@users.noreply.github.com> Date: Thu, 16 Feb 2023 10:04:19 +0300 Subject: [PATCH] Tailwind Prettier Plugin (#557) * add tailwind prettier plugin + run prettier * add eslint tailwind plugin and eslint fix to turbo * Ran eslint fix + fixed every other lint issues * twStyle and lint stuff * remove auto lint as it's buggy * update eslint & add twStyle to tailwind regex * Fix auto lint + config inconsistencies * Add tailwind config to prettier config * run lint:fix --------- Co-authored-by: Brendan Allan --- .cspell/frontend_custom_words.txt | 90 +++++++++--------- .prettierrc.js | 5 +- .vscode/settings.json | 13 ++- apps/landing/src/App.tsx | 2 +- apps/landing/src/components/AppEmbed.tsx | 16 ++-- apps/landing/src/components/BlogTag.tsx | 2 +- apps/landing/src/components/DocsLayout.tsx | 22 ++--- apps/landing/src/components/DocsSidebar.tsx | 20 ++-- apps/landing/src/components/Footer.tsx | 24 ++--- apps/landing/src/components/HomeCTA.tsx | 24 ++--- apps/landing/src/components/Markdown.tsx | 4 +- apps/landing/src/components/NavBar.tsx | 22 ++--- apps/landing/src/components/NewBanner.tsx | 8 +- apps/landing/src/components/TeamMember.tsx | 18 ++-- apps/landing/src/pages/blog/index.page.tsx | 16 ++-- apps/landing/src/pages/blog/post.page.tsx | 8 +- apps/landing/src/pages/careers.page.tsx | 54 +++++------ apps/landing/src/pages/docs/doc.page.tsx | 12 +-- apps/landing/src/pages/docs/index.page.tsx | 2 +- apps/landing/src/pages/index.page.tsx | 19 ++-- apps/landing/src/pages/roadmap.page.tsx | 26 ++--- apps/landing/src/pages/team.page.tsx | 18 ++-- apps/landing/src/renderer/_error.page.tsx | 4 +- apps/landing/src/style.scss | 12 +-- apps/mobile/src/App.tsx | 2 +- apps/mobile/src/components/device/Device.tsx | 10 +- .../src/components/explorer/FileItem.tsx | 12 +-- .../src/components/explorer/FileRow.tsx | 6 +- .../src/components/explorer/FileThumb.tsx | 4 +- apps/mobile/src/components/header/Header.tsx | 12 +-- apps/mobile/src/components/layout/Card.tsx | 7 +- .../src/components/layout/CollapsibleView.tsx | 2 +- apps/mobile/src/components/layout/Dialog.tsx | 10 +- .../src/components/primitive/Button.tsx | 16 ++-- .../src/components/primitive/Divider.tsx | 2 +- .../mobile/src/components/primitive/Input.tsx | 8 +- apps/mobile/src/components/primitive/Menu.tsx | 4 +- .../src/components/primitive/Switch.tsx | 4 +- .../components/settings/SettingsContainer.tsx | 4 +- .../src/components/settings/SettingsItem.tsx | 6 +- apps/mobile/src/containers/OverviewStats.tsx | 8 +- .../containers/dialog/tag/CreateTagDialog.tsx | 8 +- .../containers/dialog/tag/UpdateTagDialog.tsx | 14 +-- .../src/containers/drawer/DrawerContent.tsx | 8 +- .../drawer/DrawerLibraryManager.tsx | 28 +++--- .../src/containers/drawer/DrawerLocations.tsx | 12 +-- .../src/containers/drawer/DrawerTags.tsx | 12 +-- .../mobile/src/containers/menu/SortByMenu.tsx | 2 +- .../mobile/src/containers/modal/FileModal.tsx | 14 +-- .../src/containers/modal/ImportModal.tsx | 2 +- apps/mobile/src/lib/tailwind.ts | 1 + apps/mobile/src/navigation/TabNavigator.tsx | 6 +- apps/mobile/src/screens/Nodes.tsx | 2 +- apps/mobile/src/screens/NotFound.tsx | 4 +- apps/mobile/src/screens/Overview.tsx | 2 +- apps/mobile/src/screens/Search.tsx | 14 +-- apps/mobile/src/screens/Spaces.tsx | 4 +- apps/mobile/src/screens/Tag.tsx | 2 +- .../src/screens/onboarding/CreateLibrary.tsx | 6 +- .../src/screens/onboarding/Onboarding.tsx | 10 +- apps/mobile/src/screens/settings/Settings.tsx | 12 +-- .../settings/client/GeneralSettings.tsx | 14 +-- .../settings/client/LibrarySettings.tsx | 12 +-- .../library/LibraryGeneralSettings.tsx | 6 +- .../settings/library/LocationSettings.tsx | 24 ++--- .../screens/settings/library/TagsSettings.tsx | 10 +- crates/sync/example/web/src/App.tsx | 20 ++-- package.json | 2 + packages/config/eslint/base.js | 10 +- packages/config/eslint/reactNative.js | 5 + packages/config/package.json | 11 ++- packages/interface/src/AppLayout.tsx | 10 +- packages/interface/src/ErrorFallback.tsx | 10 +- packages/interface/src/NotFound.tsx | 4 +- .../components/dialog/AddLocationDialog.tsx | 2 +- .../src/components/dialog/AlertDialog.tsx | 8 +- .../components/dialog/BackupRestoreDialog.tsx | 18 ++-- .../components/dialog/CreateLibraryDialog.tsx | 38 ++++---- .../components/dialog/DecryptFileDialog.tsx | 26 ++--- .../components/dialog/EncryptFileDialog.tsx | 12 +-- .../src/components/dialog/EraseFileDialog.tsx | 6 +- .../src/components/dialog/KeyViewerDialog.tsx | 30 +++--- .../dialog/MasterPasswordChangeDialog.tsx | 26 ++--- .../src/components/explorer/Explorer.tsx | 4 +- .../explorer/ExplorerContextMenu.tsx | 13 +-- .../explorer/ExplorerOptionsPanel.tsx | 6 +- .../components/explorer/ExplorerTopBar.tsx | 15 +-- .../src/components/explorer/FileItem.tsx | 14 +-- .../src/components/explorer/FileRow.tsx | 8 +- .../src/components/explorer/FileThumb.tsx | 4 +- .../src/components/explorer/Inspector.tsx | 18 ++-- .../components/explorer/VirtualizedList.tsx | 4 +- .../components/explorer/inspector/Divider.tsx | 2 +- .../explorer/inspector/FavoriteButton.tsx | 2 +- .../components/explorer/inspector/Note.tsx | 3 +- .../src/components/items/DriveListItem.tsx | 2 +- .../src/components/jobs/JobManager.tsx | 30 +++--- packages/interface/src/components/key/Key.tsx | 32 +++---- .../interface/src/components/key/KeyList.tsx | 8 +- .../src/components/key/KeyManager.tsx | 24 ++--- .../src/components/key/KeyMounter.tsx | 26 ++--- .../src/components/key/PasswordMeter.tsx | 6 +- .../interface/src/components/layout/Modal.tsx | 14 +-- .../src/components/layout/Sidebar.tsx | 52 +++++----- .../components/location/LocationListItem.tsx | 22 ++--- .../onboarding/OnboardingMasterPassword.tsx | 12 +-- .../onboarding/OnboardingNewLibrary.tsx | 10 +- .../onboarding/OnboardingPrivacy.tsx | 2 +- .../onboarding/OnboardingProgress.tsx | 4 +- .../components/onboarding/OnboardingRoot.tsx | 14 +-- .../components/onboarding/OnboardingStart.tsx | 4 +- .../src/components/os/TrafficLights.tsx | 6 +- .../components/primitive/InputContainer.tsx | 2 +- .../src/components/primitive/Listbox.tsx | 26 ++--- .../components/primitive/PopoverPicker.tsx | 4 +- .../src/components/primitive/ProgressBar.tsx | 4 +- .../src/components/primitive/Shortcut.tsx | 2 +- .../src/components/primitive/Slider.tsx | 8 +- .../src/components/primitive/Tag.tsx | 2 +- .../src/components/primitive/Toasts.tsx | 18 ++-- .../components/settings/SettingsContainer.tsx | 6 +- .../components/settings/SettingsHeader.tsx | 8 +- .../components/settings/SettingsSidebar.tsx | 4 +- .../components/settings/SettingsSubHeader.tsx | 2 +- .../components/settings/SettingsSubPage.tsx | 8 +- .../src/components/tooltip/Tooltip.tsx | 2 +- .../src/components/transitions/SlideUp.tsx | 2 +- packages/interface/src/screens/Debug.tsx | 6 +- .../src/screens/LocationExplorer.tsx | 2 +- packages/interface/src/screens/Media.tsx | 2 +- packages/interface/src/screens/Overview.tsx | 22 ++--- packages/interface/src/screens/People.tsx | 2 +- packages/interface/src/screens/Spaces.tsx | 2 +- .../interface/src/screens/settings/Layout.tsx | 2 +- .../src/screens/settings/SettingsSubPage.tsx | 2 +- .../settings/client/ExtensionsSettings.tsx | 6 +- .../settings/client/GeneralSettings.tsx | 16 ++-- .../screens/settings/info/AboutSpacedrive.tsx | 4 +- .../screens/settings/library/KeysSetting.tsx | 28 +++--- .../library/LibraryGeneralSettings.tsx | 10 +- .../settings/library/LocationsSettings.tsx | 2 +- .../screens/settings/library/TagsSettings.tsx | 14 +-- .../library/location/EditLocation.tsx | 20 ++-- .../library/location/IndexerRuleEditor.tsx | 2 +- .../settings/node/ExperimentalSettings.tsx | 2 +- .../settings/node/LibrariesSettings.tsx | 10 +- .../src/screens/settings/node/P2PSettings.tsx | 8 +- packages/interface/src/style.scss | 18 ++-- packages/ui/src/Button.tsx | 20 ++-- packages/ui/src/CheckBox.tsx | 4 +- packages/ui/src/ContextMenu.tsx | 12 +-- packages/ui/src/Dialog.tsx | 14 +-- packages/ui/src/Dropdown.tsx | 10 +- packages/ui/src/Input.tsx | 8 +- packages/ui/src/Loader.tsx | 2 +- packages/ui/src/Popover.tsx | 8 +- packages/ui/src/Select.tsx | 20 ++-- packages/ui/src/Switch.tsx | 14 +-- packages/ui/src/forms/Form.tsx | 33 ++++--- pnpm-lock.yaml | Bin 781748 -> 784532 bytes 160 files changed, 912 insertions(+), 897 deletions(-) diff --git a/.cspell/frontend_custom_words.txt b/.cspell/frontend_custom_words.txt index 5506b5162..766e1eba1 100644 --- a/.cspell/frontend_custom_words.txt +++ b/.cspell/frontend_custom_words.txt @@ -1,84 +1,84 @@ -pnpm -titlebar -consts -pallete -unlisten -svgr -middlewares -clsx -SDWEB -tryghost -tsparticles -Opencollective -Waitlist -heroicons -roadmap -semibold -noreferer -Rescan -subpackage -photoslibrary -fontsource audiomp audioogg audiowav browserslist bsconfig cheader +classname +clsx compodoc +consts cssmap dartlang dockerdebug +falsey folderlight folderopen fontotf +fontsource fontttf fontwoff gopackage haml +headlessui +heroicons imagegif imageico imagejpg imagepng +imagewebp +immer ipynb jsmap +lacie lighteditorconfig -nestjscontroller +middlewares +moti nestjs +nestjscontroller nestjsdecorator nestjsfilter nestjsguard nestjsmodule nestjsservice +noreferer npmlock +nums nuxt +Opencollective opengl +overscan +pallete photoshop +photoslibrary +pnpm postcssconfig powershelldata -reactjs -rjson -symfony -testjs -tmpl -typescriptdef -windi -yarnerror -unlisten -imagewebp powershellmodule +pressable +reactjs reactts -testts -zustand -overscan -webp -headlessui -falsey -nums -lacie -classname -wunsub -immer +Rescan +rjson +roadmap +SDWEB +semibold +subpackage +svgr +swipeable +symfony tada -moti -pressable \ No newline at end of file +testjs +testts +titlebar +tmpl +tryghost +tsparticles +typescriptdef +unlisten +Waitlist +webp +windi +wunsub +yarnerror +zustand diff --git a/.prettierrc.js b/.prettierrc.js index 2f76aa8c8..0b0725ac0 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -21,6 +21,7 @@ module.exports = { ], importOrderSortSpecifiers: true, importOrderParserPlugins: ['importAssertions', 'typescript', 'jsx'], - pluginSearchDirs: ['.'], - plugins: ['@trivago/prettier-plugin-sort-imports'] + pluginSearchDirs: false, + plugins: ['@trivago/prettier-plugin-sort-imports', 'prettier-plugin-tailwindcss'], + tailwindConfig: 'packages/ui/tailwind.config.js' }; diff --git a/.vscode/settings.json b/.vscode/settings.json index c22255326..e62e8f133 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "cSpell.words": [ "actix", "bpfrpt", + "callees", "consts", "countup", "creationdate", @@ -41,7 +42,8 @@ "tw`([^`]*)", "tw\\.[^`]+`([^`]*)`", "tw\\(.*?\\).*?`([^`]*)", - "tw\\.style\\(([^)]*)\\)" + "tw\\.style\\(([^)]*)\\)", + "twStyle\\(([^)]*)\\)" ], "search.exclude": { "**/node_modules": true, @@ -50,5 +52,12 @@ // Hiding these folders bcs they create a lot of noise in the search results "apps/mobile/android": true, "apps/mobile/ios": true - } + }, + "eslint.workingDirectories": [ + "apps/landing", + "apps/mobile", + "packages/ui", + "packages/client", + "packages/interface" + ] } diff --git a/apps/landing/src/App.tsx b/apps/landing/src/App.tsx index d8209d17b..edae5f4f0 100644 --- a/apps/landing/src/App.tsx +++ b/apps/landing/src/App.tsx @@ -25,7 +25,7 @@ export default function App({ <> -
+
{children}