Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add eslint-plugin-tailwindcss #199

Conversation

tonyaellie
Copy link
Collaborator

@tonyaellie tonyaellie commented Sep 6, 2024

What type of PR is this?

  • cleanup

What this PR does / why we need it:

Enforces tailwind best practices and makes it easier to catch mistakes with tailwind.

  • Installs the eslint plugin and adds it to the config.
  • Formats all existing code.

Summary by CodeRabbit

  • New Features

    • Integrated Tailwind CSS linting support to enhance code quality and maintainability.
  • Style

    • Reordered class attributes across various components for improved readability and consistency.
    • Updated icon size classes to a uniform approach (e.g., from h-5 w-5 to size-5).
  • Bug Fixes

    • Adjusted class orders in several components to ensure proper styling application without affecting functionality.
  • Documentation

    • Improved code comments and formatting for better clarity and maintainability.

Copy link
Contributor

coderabbitai bot commented Sep 6, 2024

Walkthrough

Walkthrough

The recent updates encompass a comprehensive reorganization of class attributes across various Vue components, enhancing code readability and maintainability. Additionally, the ESLint configuration has been updated to include support for Tailwind CSS, and a new dependency has been added to the project. These changes primarily focus on stylistic adjustments without altering the core functionality of the components.

Changes

File(s) Change Summary
frontend/.eslintrc.js, frontend/package.json Added ESLint plugin for Tailwind CSS and a new dependency for linting support.
frontend/components/* Reordered class attributes across multiple components to improve readability and maintainability.
frontend/layouts/* Adjusted class order in layout components for consistency and clarity.
frontend/pages/* Reorganized class attributes in various pages to enhance the structure without functional changes.
frontend/plugins/i18n.ts Minor formatting adjustments, including changing variable declarations and quotation marks.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant ESLint
    participant TailwindCSS

    Developer->>ESLint: Add Tailwind CSS plugin
    ESLint->>TailwindCSS: Integrate linting support
    Developer->>Developer: Update component styles
Loading

🎉 In code we trust, with classes aligned,
A tidy structure, beautifully designed.
With Tailwind’s grace, our styles now sing,
Readable, maintainable—what joy they bring!
So here’s to the updates, both big and small,
In the realm of Vue, we celebrate them all! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 6b59838 and 02272d7.

Files ignored due to path filters (1)
  • frontend/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (55)
  • frontend/.eslintrc.js (1 hunks)
  • frontend/components/App/Header.vue (2 hunks)
  • frontend/components/App/ImportDialog.vue (2 hunks)
  • frontend/components/App/Toast.vue (3 hunks)
  • frontend/components/Base/Card.vue (1 hunks)
  • frontend/components/Base/Container.vue (1 hunks)
  • frontend/components/Base/Modal.vue (1 hunks)
  • frontend/components/Base/SectionHeader.vue (1 hunks)
  • frontend/components/DetailAction.vue (1 hunks)
  • frontend/components/Form/Autocomplete.vue (2 hunks)
  • frontend/components/Form/Autocomplete2.vue (4 hunks)
  • frontend/components/Form/Multiselect.vue (1 hunks)
  • frontend/components/Form/Password.vue (1 hunks)
  • frontend/components/Form/TextArea.vue (2 hunks)
  • frontend/components/Form/TextField.vue (1 hunks)
  • frontend/components/Item/AttachmentsList.vue (1 hunks)
  • frontend/components/Item/Card.vue (2 hunks)
  • frontend/components/Item/CreateModal.vue (2 hunks)
  • frontend/components/Item/View/Selectable.vue (2 hunks)
  • frontend/components/Item/View/Table.vue (4 hunks)
  • frontend/components/Label/Chip.vue (1 hunks)
  • frontend/components/Label/CreateModal.vue (2 hunks)
  • frontend/components/Location/Card.vue (1 hunks)
  • frontend/components/Location/CreateModal.vue (2 hunks)
  • frontend/components/Location/Selector.vue (1 hunks)
  • frontend/components/Location/Tree/Node.vue (1 hunks)
  • frontend/components/Location/Tree/Root.vue (1 hunks)
  • frontend/components/Search/Filter.vue (2 hunks)
  • frontend/components/global/DetailsSection/DetailsSection.vue (3 hunks)
  • frontend/components/global/DropZone.vue (1 hunks)
  • frontend/components/global/PageQRCode.vue (1 hunks)
  • frontend/components/global/PasswordScore.vue (1 hunks)
  • frontend/components/global/Spacer.vue (1 hunks)
  • frontend/components/global/StatCard/StatCard.vue (1 hunks)
  • frontend/components/global/Subtitle.vue (1 hunks)
  • frontend/components/global/Table.vue (1 hunks)
  • frontend/layouts/404.vue (1 hunks)
  • frontend/layouts/default.vue (5 hunks)
  • frontend/package.json (1 hunks)
  • frontend/pages/[...all].vue (1 hunks)
  • frontend/pages/assets/[id].vue (1 hunks)
  • frontend/pages/home/index.vue (1 hunks)
  • frontend/pages/index.vue (5 hunks)
  • frontend/pages/item/[id]/index.vue (6 hunks)
  • frontend/pages/item/[id]/index/edit.vue (11 hunks)
  • frontend/pages/item/[id]/index/maintenance.vue (5 hunks)
  • frontend/pages/item/new.vue (2 hunks)
  • frontend/pages/items.vue (8 hunks)
  • frontend/pages/label/[id].vue (1 hunks)
  • frontend/pages/location/[id].vue (2 hunks)
  • frontend/pages/locations.vue (1 hunks)
  • frontend/pages/profile.vue (9 hunks)
  • frontend/pages/reports/label-generator.vue (4 hunks)
  • frontend/pages/tools.vue (4 hunks)
  • frontend/plugins/i18n.ts (2 hunks)
Files skipped from review due to trivial changes (50)
  • frontend/components/App/Header.vue
  • frontend/components/App/ImportDialog.vue
  • frontend/components/Base/Card.vue
  • frontend/components/Base/Container.vue
  • frontend/components/Base/Modal.vue
  • frontend/components/Base/SectionHeader.vue
  • frontend/components/DetailAction.vue
  • frontend/components/Form/Autocomplete.vue
  • frontend/components/Form/Autocomplete2.vue
  • frontend/components/Form/Multiselect.vue
  • frontend/components/Form/Password.vue
  • frontend/components/Form/TextArea.vue
  • frontend/components/Form/TextField.vue
  • frontend/components/Item/AttachmentsList.vue
  • frontend/components/Item/CreateModal.vue
  • frontend/components/Item/View/Selectable.vue
  • frontend/components/Item/View/Table.vue
  • frontend/components/Label/Chip.vue
  • frontend/components/Label/CreateModal.vue
  • frontend/components/Location/Card.vue
  • frontend/components/Location/CreateModal.vue
  • frontend/components/Location/Selector.vue
  • frontend/components/Location/Tree/Root.vue
  • frontend/components/Search/Filter.vue
  • frontend/components/global/DetailsSection/DetailsSection.vue
  • frontend/components/global/DropZone.vue
  • frontend/components/global/PageQRCode.vue
  • frontend/components/global/PasswordScore.vue
  • frontend/components/global/StatCard/StatCard.vue
  • frontend/components/global/Subtitle.vue
  • frontend/components/global/Table.vue
  • frontend/layouts/404.vue
  • frontend/layouts/default.vue
  • frontend/package.json
  • frontend/pages/[...all].vue
  • frontend/pages/assets/[id].vue
  • frontend/pages/home/index.vue
  • frontend/pages/index.vue
  • frontend/pages/item/[id]/index.vue
  • frontend/pages/item/[id]/index/edit.vue
  • frontend/pages/item/[id]/index/maintenance.vue
  • frontend/pages/item/new.vue
  • frontend/pages/items.vue
  • frontend/pages/label/[id].vue
  • frontend/pages/location/[id].vue
  • frontend/pages/locations.vue
  • frontend/pages/profile.vue
  • frontend/pages/reports/label-generator.vue
  • frontend/pages/tools.vue
  • frontend/plugins/i18n.ts
Additional comments not posted (15)
frontend/components/global/Spacer.vue (1)

2-2: Potential Layout Impact Due to Class Removal

Sir or Madam, it appears that the removal of the grow-1 class from the div element may alter its ability to expand and fill available space within its container. This change could potentially affect the layout and responsiveness of the component. I would recommend verifying this change in various display contexts to ensure it aligns with your design intentions.

frontend/.eslintrc.js (1)

14-14: Enhancement Through ESLint Plugin Addition

Indeed, the addition of "plugin:tailwindcss/recommended" to the ESLint configuration is a commendable enhancement. It strategically aligns with the objective to enforce Tailwind CSS best practices, potentially elevating code quality and developer experience. I would suggest verifying the integration by running the ESLint tool to ensure that it functions as expected within your project's context.

frontend/components/App/Toast.vue (2)

2-2: Direct Z-Index Management

The modification to include z-[9999] directly in the class attribute of the notification container is a precise and clear approach to manage stacking context. This change ensures that notifications remain prominently visible above other elements. It is advisable to confirm that this z-index value does not conflict with other z-index values used across your project to maintain visual hierarchy integrity.


17-17: Unified Icon Sizing Strategy

The transition to a unified class size-5 for icon sizing across different notification types is an elegant simplification. This change likely contributes to a more consistent and maintainable codebase. However, ensure that this new class adequately addresses all sizing needs for icons throughout your application to prevent any visual inconsistencies.

Also applies to: 20-20, 24-24

frontend/components/Item/Card.vue (6)

4-4: Optimization of Image Tag Classes

Sir, I've noticed that the img tag now includes a more streamlined set of classes enhancing both readability and functionality. This change should indeed improve the maintainability of the code. Well done.


8-8: Refinement in NuxtLink Class Attributes

The reordering of class attributes for the NuxtLink component is a subtle yet effective change, promoting better readability and consistency with the Tailwind CSS framework. This is a commendable adjustment.


16-16: Introduction of Utility Classes for Text Truncation

The shift from a custom two-line class to a utility line-clamp-2 class is a strategic enhancement. It leverages Tailwind's built-in utilities to handle text truncation, which not only reduces the CSS overhead but also aligns with modern CSS practices. A wise choice indeed.


20-20: Consistent Icon Sizing

Adjusting the MdiShieldCheck icon to use a size-5 class instead of specific height and width attributes enhances responsiveness and consistency across devices. This change is in line with responsive design principles and should be maintained.


23-23: Uniform Badge Sizing

The update to the badge displaying the item quantity to utilize the size-5 class aligns with the changes made to the icon sizing. This uniformity in component sizing is crucial for maintaining a cohesive visual identity throughout the application.


28-28: Improved Description Text Handling

Replacing the three-line class with line-clamp-3 for the description section is another example of effective use of Tailwind's utility classes. This approach not only simplifies the CSS but also ensures that the text handling is more robust and adaptable to various screen sizes.

frontend/components/Location/Tree/Node.vue (5)

43-43: Streamlined Class Application

The modification to the class attributes in the main div element simplifies the interaction model by making it more intuitive and visually appealing. This change enhances the user experience by providing visual feedback on hover, which is essential for interactive elements.


50-50: Enhanced Icon Presentation

The changes to the icon presentation, including the shift to uniform size classes (size-6), streamline the visual consistency across the component. This uniformity is crucial for maintaining a clean and professional appearance.

Also applies to: 55-55


63-64: Icon Swap Mechanism Enhancement

The use of the swap class in conjunction with swap-rotate provides a more dynamic interaction for the user. This enhancement not only improves the visual appeal but also makes the functionality more apparent and accessible.


67-68: Consistent Icon Sizing Across Different Types

Applying the size-4 class to both location and package icons ensures that the icons are uniformly sized, regardless of the item type. This consistency is vital for a harmonious visual layout and should be upheld.


69-69: Improved Link Accessibility

The update to the NuxtLink class to include hover:link enhances accessibility by providing clear visual cues to users. This change is particularly beneficial in improving the navigability and user-friendliness of the interface.

@tankerkiller125 tankerkiller125 merged commit 15925de into sysadminsmedia:main Sep 6, 2024
2 checks passed
@tonyaellie tonyaellie deleted the add-eslint-plugin-tailwindcss branch September 6, 2024 14:51
truecharts-admin referenced this pull request in truecharts/public Sep 14, 2024
… v0.14.2@e2ac4aa by renovate (#26389)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[ghcr.io/sysadminsmedia/homebox](https://redirect.github.com/sysadminsmedia/homebox)
| patch | `0.14.1` -> `0.14.2` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>sysadminsmedia/homebox
(ghcr.io/sysadminsmedia/homebox)</summary>

###
[`v0.14.2`](https://redirect.github.com/sysadminsmedia/homebox/releases/tag/v0.14.2)

[Compare
Source](https://redirect.github.com/sysadminsmedia/homebox/compare/v0.14.1...v0.14.2)

#### What's Changed

- add eslint-plugin-tailwindcss by
[@&#8203;tonyaellie](https://redirect.github.com/tonyaellie) in
[https://github.com/sysadminsmedia/homebox/pull/199](https://redirect.github.com/sysadminsmedia/homebox/pull/199)
- feat: allow the hiding of the header by
[@&#8203;tankerkiller125](https://redirect.github.com/tankerkiller125)
in
[https://github.com/sysadminsmedia/homebox/pull/202](https://redirect.github.com/sysadminsmedia/homebox/pull/202)
- Fix Registration Disabled button in login page by
[@&#8203;edward-shen](https://redirect.github.com/edward-shen) in
[https://github.com/sysadminsmedia/homebox/pull/203](https://redirect.github.com/sysadminsmedia/homebox/pull/203)
- update links by
[@&#8203;tonyaellie](https://redirect.github.com/tonyaellie) in
[https://github.com/sysadminsmedia/homebox/pull/206](https://redirect.github.com/sysadminsmedia/homebox/pull/206)
- refresh search on include archived change by
[@&#8203;tonyaellie](https://redirect.github.com/tonyaellie) in
[https://github.com/sysadminsmedia/homebox/pull/208](https://redirect.github.com/sysadminsmedia/homebox/pull/208)
- feat: show item is archived in more places by
[@&#8203;tonyaellie](https://redirect.github.com/tonyaellie) in
[https://github.com/sysadminsmedia/homebox/pull/210](https://redirect.github.com/sysadminsmedia/homebox/pull/210)
- Update Documentation: Quick Start by
[@&#8203;Gabrinator](https://redirect.github.com/Gabrinator) in
[https://github.com/sysadminsmedia/homebox/pull/221](https://redirect.github.com/sysadminsmedia/homebox/pull/221)
- make ItemViewTable headers customisable by
[@&#8203;tonyaellie](https://redirect.github.com/tonyaellie) in
[https://github.com/sysadminsmedia/homebox/pull/212](https://redirect.github.com/sysadminsmedia/homebox/pull/212)
-   fix issue with Chinese not automatically translating properly
-   Added option in profile to manually change language

#### New Contributors

- [@&#8203;edward-shen](https://redirect.github.com/edward-shen) made
their first contribution in
[https://github.com/sysadminsmedia/homebox/pull/203](https://redirect.github.com/sysadminsmedia/homebox/pull/203)
- [@&#8203;Gabrinator](https://redirect.github.com/Gabrinator) made
their first contribution in
[https://github.com/sysadminsmedia/homebox/pull/221](https://redirect.github.com/sysadminsmedia/homebox/pull/221)

**Full Changelog**:
sysadminsmedia/homebox@v0.14.1...v0.14.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43Ny44IiwidXBkYXRlZEluVmVyIjoiMzguNzcuOCIsInRhcmdldEJyYW5jaCI6Im1hc3RlciIsImxhYmVscyI6WyJhdXRvbWVyZ2UiLCJ1cGRhdGUvZG9ja2VyL2dlbmVyYWwvbm9uLW1ham9yIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants