Skip to content

Conversation

@elibosley
Copy link
Member

@elibosley elibosley commented Apr 2, 2025

Summary by CodeRabbit

  • Chores

    • Introduced a linting step in the build process to enhance code quality.
    • Updated configuration settings with a version upgrade and adjustments to network port specifications.
    • Refined package and TypeScript configurations for improved module resolution and maintainability.
  • Style

    • Standardized code formatting with consistent quotation usage, semicolon additions, and reorganized import paths for clarity.
    • Enhanced readability of SVG markup and component templates through formatting adjustments.
    • Simplified property definitions and improved code organization within components for better readability.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 2, 2025

Walkthrough

This update introduces a new "Lint" step in the GitHub Actions workflow, adds and refines configuration settings for network access and UPnP in server configuration files, and replaces legacy ESLint settings with a TypeScript-based configuration. Numerous components have undergone stylistic adjustments including changes in quotation styles, semicolon additions, and import path revisions. Additionally, TypeScript configuration files have been updated or removed to reflect stricter type-checking and improved module resolution.

Changes

File(s) Change Summary
.github/workflows/main.yml Added a new "Lint" step in the build-unraid-ui-webcomponents job, which runs pnpm run lint between dependency installation and build.
api/dev/Unraid.net/myservers.cfg, api/dev/states/myservers.cfg Updated configuration values: version bump, extraOrigins spacing, cleared wanport, enabled UPnP, and updated upnpStatus in states file.
unraid-ui/.eslintrc.js, unraid-ui/eslint.config.ts Removed the old ESLint configuration file and introduced a new TypeScript-compatible ESLint config with updated plugins and rules.
unraid-ui/package.json Modified scripts: replaced rm -rf with rimraf for cleaning, added lint and lint:fix scripts, and added linting-related devDependencies.
unraid-ui/src/components/**/* Various components updated with changes to string delimiters (double to single quotes), semicolon additions, and adjustments to import paths (relative to absolute).
unraid-ui/src/env.d.ts, unraid-ui/src/types/badge.ts, unraid-ui/src/types/components.d.ts Updated Vue component type declarations in env.d.ts, removed obsolete components type definitions, and reordered import statements in types files.
unraid-ui/src/forms/* Modified import paths from relative to absolute for renderer entries and layout components, alongside minor formatting updates in declaration files.
unraid-ui/src/index.ts, unraid-ui/src/register.ts, unraid-ui/src/theme/preset.ts Changed style import paths to absolute references and updated object key syntax in the theme preset configuration.
unraid-ui/tsconfig*.json Overhauled TypeScript configuration: removed tsconfig.app.json extension, added stricter compiler options and path mappings in tsconfig.json, introduced "noEmit": true in tsconfig.node.json, and removed tsconfig.test.json.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant CI as GitHub Actions
    Dev->>CI: Push commit
    CI->>CI: Install dependencies
    CI->>CI: Run Lint (pnpm run lint)
    CI->>CI: Build project
    CI->>CI: Continue with remaining jobs
Loading

Suggested reviewers

  • mdatelle
  • pujitm
  • zackspear

Poem

Code flows like a gentle stream,
With linting now part of the dream.
Configs and imports all set right,
Clean and crisp in every byte.
Cheers to style and syntax so bright!
🚀✨
Happy coding into the night!


🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 plan to trigger planning for file edits and PR creation.
  • @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: 5

🧹 Nitpick comments (6)
unraid-ui/src/register.ts (2)

2-2: Observation: Absolute CSS Import Alignment

The import on line 2 (import '@app/styles/index.css';) is now using an absolute path, which aligns with similar updates elsewhere in the codebase. Just double-check that your build configuration supports the @app alias to avoid resolution issues.


13-19: Review: Inconsistent Default Shared CSS Path

Within the registerAllComponents function, the default for pathToSharedCss is set to './src/styles/index.css', which differs from the absolute path style used in the rest of the project. For consistency, consider updating it to '@app/styles/index.css' unless there is a specific reason to retain the relative path.

unraid-ui/eslint.config.ts (2)

62-66: Consider checking data properties as well

The vue/no-unused-properties rule is only checking props, but you might want to consider checking data properties too.

'vue/no-unused-properties': ['error', {
-  groups: ['props'],
+  groups: ['props', 'data'],
  deepData: false,
  ignorePublicMembers: false
}],

77-77: Expand GraphQL ignore paths to include common patterns

You're currently ignoring generated GraphQL client files, but you might want to expand this to cover all generated GraphQL files.

-  ignores: ['src/graphql/generated/client/**/*'],
+  ignores: ['src/graphql/generated/**/*', '**/*.graphql.ts'],
unraid-ui/package.json (1)

71-71: Consider using consistent version constraints

Your newly added dependencies use inconsistent versioning constraints. Consider standardizing to either caret (^) or tilde (~) for all.

Also applies to: 82-82, 88-88

unraid-ui/tsconfig.json (1)

37-39: Simplify the include patterns

The include section has some redundancy. Since you're already including all TypeScript files in the src directory, you can simplify your configuration.

"include": [
  "src/**/*.ts",
  "src/**/*.d.ts",
  "src/**/*.tsx",
  "src/**/*.vue",
  "src/**/*.ce.vue",
  "tailwind.config.ts",
- "src/theme/**/*.ts",
  "**/*.config.ts"
],
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7a421ce and fe4a77c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (35)
  • .github/workflows/main.yml (1 hunks)
  • api/dev/Unraid.net/myservers.cfg (1 hunks)
  • api/dev/states/myservers.cfg (2 hunks)
  • unraid-ui/.eslintrc.js (0 hunks)
  • unraid-ui/eslint.config.ts (1 hunks)
  • unraid-ui/package.json (3 hunks)
  • unraid-ui/src/components/brand/brand-button.variants.ts (1 hunks)
  • unraid-ui/src/components/common/button/Button.test.ts (1 hunks)
  • unraid-ui/src/components/common/loading/index.ts (1 hunks)
  • unraid-ui/src/components/common/popover/index.ts (1 hunks)
  • unraid-ui/src/components/common/scroll-area/index.ts (1 hunks)
  • unraid-ui/src/components/common/sheet/index.ts (1 hunks)
  • unraid-ui/src/components/common/stepper/index.ts (1 hunks)
  • unraid-ui/src/components/common/tabs/index.ts (1 hunks)
  • unraid-ui/src/components/common/tooltip/index.ts (1 hunks)
  • unraid-ui/src/components/form/input/index.ts (1 hunks)
  • unraid-ui/src/components/form/label/index.ts (1 hunks)
  • unraid-ui/src/components/form/lightswitch/index.ts (1 hunks)
  • unraid-ui/src/components/form/select/index.ts (1 hunks)
  • unraid-ui/src/components/form/switch/index.ts (1 hunks)
  • unraid-ui/src/components/layout/index.ts (1 hunks)
  • unraid-ui/src/env.d.ts (1 hunks)
  • unraid-ui/src/forms/jsonforms.d.ts (1 hunks)
  • unraid-ui/src/forms/renderer-entries.ts (1 hunks)
  • unraid-ui/src/forms/renderers.ts (1 hunks)
  • unraid-ui/src/forms/vertical-layout.renderer.ts (1 hunks)
  • unraid-ui/src/index.ts (1 hunks)
  • unraid-ui/src/register.ts (1 hunks)
  • unraid-ui/src/theme/preset.ts (1 hunks)
  • unraid-ui/src/types/badge.ts (1 hunks)
  • unraid-ui/src/types/components.d.ts (0 hunks)
  • unraid-ui/tsconfig.app.json (0 hunks)
  • unraid-ui/tsconfig.json (2 hunks)
  • unraid-ui/tsconfig.node.json (1 hunks)
  • unraid-ui/tsconfig.test.json (0 hunks)
💤 Files with no reviewable changes (4)
  • unraid-ui/tsconfig.test.json
  • unraid-ui/.eslintrc.js
  • unraid-ui/src/types/components.d.ts
  • unraid-ui/tsconfig.app.json
🧰 Additional context used
🧠 Learnings (2)
unraid-ui/src/components/common/loading/index.ts (2)
Learnt from: elibosley
PR: unraid/api#974
File: web/components/Loading/Error.vue:1-3
Timestamp: 2025-04-02T14:32:24.570Z
Learning: In Nuxt.js projects, components are automatically imported, so explicit import statements for components like `LoadingSpinner` in `web/components/Loading/Error.vue` are not necessary.
Learnt from: pujitm
PR: unraid/api#974
File: web/components/Loading/Error.vue:50-50
Timestamp: 2025-04-02T14:32:20.884Z
Learning: In this project, the `Button` component from `~/components/shadcn/Button.vue` is autoloaded and does not need to be imported manually in components like `web/components/Loading/Error.vue`.
unraid-ui/src/components/layout/index.ts (1)
Learnt from: mdatelle
PR: unraid/api#1106
File: unraid-ui/src/components/index.ts:2-2
Timestamp: 2025-04-02T14:32:24.570Z
Learning: The unraid-ui package is undergoing a major refactoring process, and breaking changes are expected during this transition period.
🧬 Code Definitions (1)
unraid-ui/src/components/brand/brand-button.variants.ts (2)
unraid-ui/src/index.ts (1)
  • brandButtonVariants (86-86)
unraid-ui/src/components/brand/index.ts (1)
  • brandButtonVariants (2-2)
🪛 Biome (1.9.4)
unraid-ui/src/components/common/loading/index.ts

[error] 2-2: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🪛 GitHub Actions: CI - Main (API)
unraid-ui/src/index.ts

[error] Build failed: Rollup failed to resolve import '@app/styles/index.css'. This is most likely unintended because it can break your application at runtime.

unraid-ui/src/forms/renderers.ts

[error] 7-7: TS2307: Cannot find module '@app/forms/renderer-entries' or its corresponding type declarations.

unraid-ui/eslint.config.ts

[error] 3-3: Error: Cannot find module 'eslint-plugin-no-relative-import-paths'.

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (42)
api/dev/Unraid.net/myservers.cfg (4)

2-2: Version number updated to 4.4.1

The version has been updated from 4.1.3 to 4.4.1. This appears to be a significant version jump. Ensure this version update is intentional and compatible with all dependent systems.


3-3: Improved formatting in extraOrigins

Added a space after the comma in extraOrigins for better readability.


8-8: WAN port setting emptied

The WAN port has been changed from "8443" to an empty string. This might affect remote access functionality.

Are there any implications for removing the WAN port? Is this change coordinated with other configuration changes?


9-9: UPnP now enabled

UPnP has been enabled, which will allow automatic port forwarding configuration on compatible routers.

Consider the security implications of enabling UPnP. While convenient, it can potentially expose services to the internet without explicit user configuration.

api/dev/states/myservers.cfg (5)

3-3: Improved formatting in extraOrigins

Added a space after the comma in extraOrigins for better readability.


8-8: WAN port setting emptied

The WAN port has been changed from "8443" to an empty string. This might affect remote access functionality.

Ensure this change is intentional and consistent with the same change in api/dev/Unraid.net/myservers.cfg.


9-9: UPnP now enabled

UPnP has been enabled, which will allow automatic port forwarding configuration on compatible routers.

This change is consistent with the same change in api/dev/Unraid.net/myservers.cfg.


21-21: Preserved allowedOrigins configuration

The allowedOrigins list appears unchanged in content but may have been reformatted.


24-24: UPnP status updated with success message

The UPnP status now shows a successful lease renewal with specific port mapping information.

This status update is consistent with enabling UPnP in line 9 and indicates that UPnP is functioning as expected.

unraid-ui/src/components/form/label/index.ts (1)

1-2: Consistent Export Formatting.
The addition of the semicolon at the end of the export statement enhances code style consistency without affecting functionality.

unraid-ui/src/components/form/input/index.ts (1)

1-2: Style Adjustment for Export Statement.
The added semicolon at the end of the export statement aligns with the project's consistent coding style across modules.

unraid-ui/src/forms/jsonforms.d.ts (1)

3-7: Minor Formatting Cleanup.
Removing the extra space before the closing brace improves the style consistency as enforced by the new linting configurations. This is a purely cosmetic change with no impact on functionality.

unraid-ui/src/components/form/lightswitch/index.ts (1)

1-2: Standardized Quotation Usage.
Changing to single quotes in the export statement standardizes the string formatting across the project, which is beneficial for maintaining a consistent code style.

unraid-ui/src/components/common/scroll-area/index.ts (1)

1-2: Export Statement Style Enhancement.
Adding semicolons to the export statements for both ScrollArea and ScrollBar ensures a consistent code format in line with the project's updated linting rules.

unraid-ui/src/components/form/switch/index.ts (1)

1-1: Quotation Consistency: Updated the export statement to use single quotes, which aligns with our new linting rules and promotes consistency across the codebase.

unraid-ui/src/components/form/select/index.ts (1)

1-11: Consistent Exports Syntax: All export statements now end with semicolons. This subtle change reinforces uniformity in our code formatting and adheres to the new linting configuration.

unraid-ui/src/components/common/popover/index.ts (1)

1-3: Uniform Export Format: The export statements for Popover components are now consistently terminated with semicolons, which improves readability and maintains code standards set by the linter.

unraid-ui/src/components/common/tooltip/index.ts (1)

1-4: Standardized Export Statements: Adding semicolons to all export lines ensures the code conforms with the project's updated style guidelines. Great job on keeping the syntax consistent!

unraid-ui/src/components/common/tabs/index.ts (1)

1-4: Consistent and Clean Exports: The additions of semicolons in the export statements help standardize the coding style across the project. This change supports better maintainability and leverages our new linter setup.

unraid-ui/tsconfig.node.json (1)

8-9:

❓ Verification inconclusive

Review: Potential Conflict Between Composite and NoEmit Options

The addition of "noEmit": true alongside "composite": true can lead to conflicts. Composite projects typically require output files (e.g., declaration files) to support incremental builds and project references. Please verify that this configuration is intentional and that it meets your build requirements.


#!/bin/bash
# Verify if "composite" is set in unraid-ui/tsconfig.node.json
rg '"composite":' -n unraid-ui/tsconfig.node.json

Based on the intended check for a composite setup, please ensure that the use of "noEmit": true is indeed deliberate when "composite": true is (or will be) present. Composite projects need emitted outputs (such as declaration files) to support incremental builds and project references. Double-check that this configuration meets your build requirements for the Node environment.

Review Directive: Confirm Intentional Coexistence of noEmit and Composite Options

  • Verify that the inclusion of "noEmit": true alongside a composite configuration is intentional.
  • Ensure your build process does not rely on emitted files from this tsconfig (e.g., for incremental builds).
unraid-ui/src/types/badge.ts (1)

1-3: Review: Consistent Import Formatting Achieved

The updated import statements now use single quotes and have been properly reordered to align with the project’s style guidelines. No issues were found in this segment.

unraid-ui/src/components/common/stepper/index.ts (1)

1-7: Consistent Semicolon Usage

The addition of semicolons at the end of each export statement enhances consistency and adheres to our formatting guidelines without affecting functionality.

unraid-ui/src/components/common/sheet/index.ts (1)

1-9: Standardized String Delimiters

Changing the string delimiters from double quotes to single quotes aligns with our updated style rules. This purely stylistic change improves consistency across the codebase.

unraid-ui/src/components/layout/index.ts (1)

1-4: Adoption of Absolute Import Paths

Switching import paths to use absolute references (e.g., using '@app/components/...') improves maintainability and clarity. Ensure that the '@app' alias is correctly configured across the project.

.github/workflows/main.yml (1)

206-208: Integrated Linting Step

The newly added "Lint" step in the build job ensures that code quality is verified before building. This change supports our goals for improved consistency and quality.

unraid-ui/src/components/brand/brand-button.variants.ts (1)

1-81: Uniform Variant Configuration

The adjustments to use single quotes for all string literals within the variant definitions enhance readability and consistency. The changes in the variant, size, padding, compoundVariants, and defaultVariants configurations are purely stylistic and align well with our updated coding standards.

unraid-ui/src/forms/vertical-layout.renderer.ts (2)

1-1: Absolute Import Path Update for VerticalLayout.
Changing the import to @app/forms/VerticalLayout.vue improves consistency and clarity. Please ensure that your TypeScript configuration (e.g. tsconfig.json) includes the correct path mappings for the @app alias.


5-8: Export Object Remains Consistent.
The exported verticalLayoutEntry correctly maps the renderer and tester. No issues detected here.

unraid-ui/src/components/common/button/Button.test.ts (5)

1-3: Consistent Import and String Literal Update.
The updated import for the Button now uses an absolute path and the use of single quotes aligns with the new linting rules.


5-14: Default Props Test Verification.
The test case for rendering the Button with default props is clear and consistent with the updated styling rules.


16-26: Variant Props Test is Clear.
The test correctly renders the Button with different variants by updating the props and slots. The consistency in string literals is maintained.


28-38: Sizing Test Properly Updated.
Checking different sizes with re-rendering works fine. The changes adhere to the new ESLint standards regarding quotation marks.


40-52: Additional CSS Classes Test Validation.
This test accurately confirms that additional classes (like custom-class) are applied. The update follows the uniform style guidelines.

unraid-ui/src/theme/preset.ts (1)

23-25: Simplified Key Notation for gridTemplateColumns.
Changing the key from a string literal ('settings') to an identifier (settings) makes the code cleaner. This is a valid ES syntax improvement as long as it does not conflict with any reserved keywords.

unraid-ui/src/forms/renderer-entries.ts (1)

1-5: Absolute Import Paths for Renderer Components.
Updating the imports of the renderer components to use absolute paths (e.g. @app/forms/NumberField.vue) enhances maintainability. Please verify that these modules are correctly available under the new paths in your project configuration.

unraid-ui/src/forms/renderers.ts (2)

8-9: Import Order Improvement.
The import for vanillaRenderers has been moved to immediately follow the renderer entries import, which improves clarity.


1-8:

❓ Verification inconclusive

Critical Module Resolution Issue with Absolute Path.
The change to import renderer entries from @app/forms/renderer-entries is causing the TypeScript error TS2307 ("Cannot find module '@app/forms/renderer-entries'"). Please verify that the TypeScript configuration (e.g. tsconfig.json) includes an appropriate "paths" mapping for the @app/* alias and that the module exists at the specified location.


Below is a shell script to gather more details on the issue by checking if the necessary TypeScript path alias exists and if the renderer entries module can be found:

Once you run this script and review its output, please verify that:

  • tsconfig.json includes a proper "paths" mapping for "@app/*" so that the alias resolves correctly.
  • The module exists at the expected location (likely within unraid-ui/src/forms/renderer-entries) as referenced by the alias.

Action Required: Validate TS Path Alias Configuration

The import of @app/forms/renderer-entries is currently triggering TS2307 ("Cannot find module '@app/forms/renderer-entries'"). Please confirm that your TypeScript configuration (e.g., the "paths" mapping in tsconfig.json) correctly maps "@app/*" to the appropriate directory and that the module exists there.


🏁 Script executed:

#!/bin/bash
# Check for alias mapping in tsconfig.json for '@app/*'
if [ -f tsconfig.json ]; then
  echo "Checking for '@app/*' alias mapping in tsconfig.json:"
  grep -R '"@app/\*":' tsconfig.json || echo "No '@app/*' alias mapping found in tsconfig.json."
else
  echo "tsconfig.json not found in the repository root."
fi

# Search for a file or directory related to renderer-entries
echo "Searching for 'renderer-entries' files or directories:"
fd renderer-entries || echo "No files or directories containing 'renderer-entries' found."

Length of output: 440


Action Required: Verify TypeScript Alias Configuration

The module file at unraid-ui/src/forms/renderer-entries.ts exists, but the TS alias for @app/* wasn't found in a tsconfig.json at the repository root. Please ensure one of the following:

  • If a tsconfig.json with the "paths" mapping for "@app/*" exists in a subdirectory (e.g., under unraid-ui), confirm that your build and IDE configurations reference it correctly.
  • Otherwise, add or update the tsconfig.json at the project root with the proper "paths" mapping to resolve imports like @app/forms/renderer-entries.
🧰 Tools
🪛 GitHub Actions: CI - Main (API)

[error] 7-7: TS2307: Cannot find module '@app/forms/renderer-entries' or its corresponding type declarations.

unraid-ui/src/env.d.ts (2)

3-7: Good improvement in type safety

The change from any to unknown and using Record<string, never> for empty objects improves type safety and follows TypeScript best practices.


9-13: Consistent module declaration for custom elements

Adding dedicated type declarations for custom element Vue files (.ce.vue) ensures proper typing support for these components.

unraid-ui/package.json (1)

27-27: Cross-platform solution for cleaning

Replacing rm -rf with rimraf makes the clean script work across different operating systems including Windows.

unraid-ui/tsconfig.json (2)

3-17: Good compiler options for modern TypeScript

The added compiler options provide a solid foundation for modern TypeScript development with strict type checking. The settings for ES2020, strict mode, and unused variable/parameter checking will help catch errors early.


19-27:

❓ Verification inconclusive

Path mapping inconsistency with ESLint configuration

Your tsconfig.json path mappings use @/* but your ESLint configuration (no-relative-import-paths) uses @app as the prefix. This inconsistency could lead to confusion and errors.


🏁 Script executed:

#!/bin/bash
# Check which import path style is used in the codebase
echo "Checking for @/* imports:"
rg "from '@/" src/
echo "Checking for @app imports:"
rg "from '@app" src/

Length of output: 263


Ensure Consistency between TypeScript and ESLint Import Aliases

The current tsconfig.json (lines 19–27 in unraid-ui/tsconfig.json) defines path aliases using @/*, while the ESLint configuration (via the no-relative-import-paths rule) appears to expect the @app prefix. This misalignment can lead to confusion or errors when resolving module imports.

Next Steps:

  • Manual Verification:
    Since the initial automated search (targeting a presumed src/ directory) didn’t return useful results, please verify whether the source files are located under a different directory (e.g., unraid-ui/src) and confirm which alias is actively used in the codebase.

  • Configuration Alignment:
    Once the actual alias usage is confirmed, update either:

    • The ESLint configuration to match the @/* alias defined in tsconfig.json, or
    • The TypeScript path mappings to use @app if that is the intended convention.

Please review the ESLint configuration files (e.g., .eslintrc.js or similar) to locate references to @app and ensure they align with the path mappings in tsconfig.json.

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: 1

♻️ Duplicate comments (1)
unraid-ui/src/components/common/loading/index.ts (1)

2-2: ⚠️ Potential issue

Rename the Error import to avoid shadowing the global Error object.

The import name Error shadows the built-in JavaScript Error object, which could lead to confusion or bugs. Consider renaming it to something like LoadingError.

-import Error from '@/components/common/loading/Error.vue';
+import LoadingError from '@/components/common/loading/Error.vue';

 export { Bar, Error, Spinner };

You would also need to update the export statement:

-export { Bar, Error, Spinner };
+export { Bar, LoadingError as Error, Spinner };

This way, external code will still work with the same API while avoiding variable shadowing internally.

🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🧹 Nitpick comments (1)
unraid-ui/src/components/common/sheet/Sheet.vue (1)

7-7: Props definition simplified.

The class property has been removed from the props definition. Make sure that this change doesn't break any existing instances where a class prop was being passed to this component.

If you still need to style this component, consider using the class attribute directly on the template or leveraging CSS scoping instead.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 465ea1d and b078102.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (34)
  • unraid-ui/eslint.config.ts (1 hunks)
  • unraid-ui/package.json (3 hunks)
  • unraid-ui/src/components/brand/BrandButton.vue (5 hunks)
  • unraid-ui/src/components/brand/BrandLoading.ce.vue (1 hunks)
  • unraid-ui/src/components/brand/BrandLogoConnect.vue (2 hunks)
  • unraid-ui/src/components/common/badge/Badge.vue (1 hunks)
  • unraid-ui/src/components/common/button/Button.test.ts (1 hunks)
  • unraid-ui/src/components/common/button/Button.vue (1 hunks)
  • unraid-ui/src/components/common/loading/Error.vue (3 hunks)
  • unraid-ui/src/components/common/loading/Spinner.vue (1 hunks)
  • unraid-ui/src/components/common/loading/index.ts (1 hunks)
  • unraid-ui/src/components/common/popover/PopoverTrigger.vue (1 hunks)
  • unraid-ui/src/components/common/scroll-area/ScrollArea.vue (1 hunks)
  • unraid-ui/src/components/common/sheet/Sheet.vue (2 hunks)
  • unraid-ui/src/components/common/sheet/SheetContent.vue (1 hunks)
  • unraid-ui/src/components/common/sheet/SheetFooter.vue (1 hunks)
  • unraid-ui/src/components/common/sheet/SheetHeader.vue (1 hunks)
  • unraid-ui/src/components/form/input/Input.vue (1 hunks)
  • unraid-ui/src/components/form/lightswitch/Lightswitch.vue (3 hunks)
  • unraid-ui/src/components/layout/PageContainer.vue (1 hunks)
  • unraid-ui/src/components/layout/index.ts (1 hunks)
  • unraid-ui/src/forms/ControlLayout.vue (2 hunks)
  • unraid-ui/src/forms/NumberField.vue (1 hunks)
  • unraid-ui/src/forms/PreconditionsLabel.vue (1 hunks)
  • unraid-ui/src/forms/Select.vue (1 hunks)
  • unraid-ui/src/forms/StringArrayField.vue (3 hunks)
  • unraid-ui/src/forms/Switch.vue (2 hunks)
  • unraid-ui/src/forms/VerticalLayout.vue (2 hunks)
  • unraid-ui/src/forms/renderer-entries.ts (1 hunks)
  • unraid-ui/src/forms/renderers.ts (1 hunks)
  • unraid-ui/src/forms/vertical-layout.renderer.ts (1 hunks)
  • unraid-ui/src/index.ts (1 hunks)
  • unraid-ui/src/register.ts (1 hunks)
  • unraid-ui/tsconfig.json (2 hunks)
✅ Files skipped from review due to trivial changes (19)
  • unraid-ui/src/components/common/popover/PopoverTrigger.vue
  • unraid-ui/src/forms/ControlLayout.vue
  • unraid-ui/src/components/common/sheet/SheetFooter.vue
  • unraid-ui/src/components/common/badge/Badge.vue
  • unraid-ui/src/components/common/loading/Spinner.vue
  • unraid-ui/src/forms/Select.vue
  • unraid-ui/src/forms/PreconditionsLabel.vue
  • unraid-ui/src/components/common/sheet/SheetHeader.vue
  • unraid-ui/src/components/brand/BrandLogoConnect.vue
  • unraid-ui/src/components/layout/PageContainer.vue
  • unraid-ui/src/components/common/button/Button.vue
  • unraid-ui/src/forms/StringArrayField.vue
  • unraid-ui/src/forms/Switch.vue
  • unraid-ui/src/forms/NumberField.vue
  • unraid-ui/src/components/common/scroll-area/ScrollArea.vue
  • unraid-ui/src/forms/VerticalLayout.vue
  • unraid-ui/src/components/form/input/Input.vue
  • unraid-ui/src/components/brand/BrandLoading.ce.vue
  • unraid-ui/src/components/common/sheet/SheetContent.vue
🚧 Files skipped from review as they are similar to previous changes (9)
  • unraid-ui/src/components/common/button/Button.test.ts
  • unraid-ui/src/index.ts
  • unraid-ui/src/register.ts
  • unraid-ui/src/components/layout/index.ts
  • unraid-ui/src/forms/renderer-entries.ts
  • unraid-ui/eslint.config.ts
  • unraid-ui/src/forms/vertical-layout.renderer.ts
  • unraid-ui/src/forms/renderers.ts
  • unraid-ui/package.json
🧰 Additional context used
🧠 Learnings (2)
unraid-ui/src/components/common/loading/Error.vue (1)
Learnt from: pujitm
PR: unraid/api#974
File: web/components/Loading/Error.vue:50-50
Timestamp: 2025-04-02T14:32:20.884Z
Learning: In this project, the `Button` component from `~/components/shadcn/Button.vue` is autoloaded and does not need to be imported manually in components like `web/components/Loading/Error.vue`.
unraid-ui/src/components/common/loading/index.ts (2)
Learnt from: elibosley
PR: unraid/api#974
File: web/components/Loading/Error.vue:1-3
Timestamp: 2025-04-02T14:32:24.570Z
Learning: In Nuxt.js projects, components are automatically imported, so explicit import statements for components like `LoadingSpinner` in `web/components/Loading/Error.vue` are not necessary.
Learnt from: pujitm
PR: unraid/api#974
File: web/components/Loading/Error.vue:50-50
Timestamp: 2025-04-02T14:32:20.884Z
Learning: In this project, the `Button` component from `~/components/shadcn/Button.vue` is autoloaded and does not need to be imported manually in components like `web/components/Loading/Error.vue`.
🪛 Biome (1.9.4)
unraid-ui/src/components/common/loading/index.ts

[error] 2-2: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (21)
unraid-ui/src/components/common/sheet/Sheet.vue (1)

27-27: Type safety improvement.

Removing the as any type assertion is a good practice that enables proper TypeScript type checking. This change aligns with modern TypeScript best practices and improves code quality.

unraid-ui/src/components/form/lightswitch/Lightswitch.vue (6)

5-6: Clean import statements.

The imports are properly organized with component imports from Headless UI followed by Vue core functionality.


8-10: Props simplified correctly.

The component definition has been simplified by removing the withDefaults function and the optional description property. This makes the component's API cleaner and more focused.


32-32: Improved class binding formatting.

The conditional class binding has been consolidated into a single line, improving readability while maintaining the same functionality.


37-37: Consistent SVG element formatting.

The SVG element attributes are properly formatted on a single line.


49-49: Consistent conditional class formatting.

Similar to line 32, this conditional class binding has been consolidated into a single line for better readability.


54-54: Consistent SVG element formatting.

The SVG element attributes are properly formatted on a single line, consistent with the earlier SVG element.

unraid-ui/src/components/brand/BrandButton.vue (6)

2-2: Import path updated to use absolute path

The import path has been updated from a relative path to an absolute path with the @/ prefix. This change aligns with the TypeScript configuration updates that improve path resolution and is a good practice for consistency.


4-4: Import statement for computed added

The computed import from Vue has been explicitly added. This ensures the dependency is properly tracked and improves code clarity.


16-17: Type safety improvement: any → unknown

Replacing any with unknown for the icon and iconRight properties improves type safety. The unknown type requires type checking before use, unlike any which bypasses type checking.


46-49: Improved formatting for cn function call

The formatting change improves readability by splitting the function call across multiple lines. This is a good practice for maintaining readable code, especially for function calls with multiple parameters.


80-80: Reformatted component rendering

The icon component rendering has been reformatted to a single line, improving code consistency without changing functionality.


90-91: Reformatted conditional class assignment

The conditional class assignment for iconRightHoverDisplay has been reformatted to improve readability while maintaining the same logic.

unraid-ui/tsconfig.json (5)

3-17: Comprehensive TypeScript configuration update

The compiler options have been significantly updated to align with modern TypeScript practices:

  • Set target to ES2020 with appropriate library definitions
  • Enabled strict type checking with various safety features
  • Configured module resolution for bundler compatibility
  • Added important flags like noUnusedLocals and noUnusedParameters

These changes will improve code quality, catch more issues at compile time, and provide better development experience.


21-23: Enhanced path mappings

More specific path mappings for components, lib, and types have been added. These mappings help with better type resolution and import paths, making the codebase more maintainable.


28-35: Added necessary type definitions

Type definitions for various dependencies and tools have been explicitly included:

  • Vite and Vitest for the build and test system
  • DOM and Node.js types
  • Vue testing utilities

This ensures that TypeScript can properly understand these libraries and prevents type errors.


44-47: Updated included file patterns

The list of files included in the TypeScript compilation has been expanded to include:

  • Tailwind configuration
  • Theme TypeScript files
  • All configuration files

This ensures proper type checking across all relevant files in the project.


57-57: Simplified configuration structure

The configuration has been simplified by removing the references section, which likely pointed to another config file. This aligns with the PR objective of simplifying TypeScript configurations.

unraid-ui/src/components/common/loading/index.ts (1)

1-3: Using absolute imports improves maintainability.

The change from relative to absolute imports makes the code more maintainable, especially in larger projects where file locations might change. This approach reduces the complexity of path resolution.

🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

unraid-ui/src/components/common/loading/Error.vue (2)

2-5: Using absolute imports is consistent with project standards.

The switch from relative to absolute imports aligns with the changes in the index.ts file and helps maintain consistency throughout the codebase.


31-31: Style improvements conform to linting standards.

The changes from double to single quotes and formatting improvements align with the PR objective of adding linting to the unraid UI. These changes improve code consistency.

Also applies to: 34-34, 37-37, 52-52

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between b078102 and 04f3b23.

📒 Files selected for processing (3)
  • api/dev/Unraid.net/myservers.cfg (1 hunks)
  • api/dev/states/myservers.cfg (2 hunks)
  • api/src/__test__/store/modules/config.test.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • api/dev/Unraid.net/myservers.cfg
  • api/dev/states/myservers.cfg
🧰 Additional context used
🪛 GitHub Check: Build API
api/src/__test__/store/modules/config.test.ts

[failure] 22-22:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················


[failure] 72-72:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················

🪛 GitHub Check: Test API
api/src/__test__/store/modules/config.test.ts

[failure] 22-22:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················


[failure] 72-72:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················

🪛 GitHub Actions: CI - Main (API)
api/src/__test__/store/modules/config.test.ts

[error] 22-22: Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎··················· prettier/prettier

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (1)
api/src/__test__/store/modules/config.test.ts (1)

22-22: Logical change in test verification.

The test has been updated from using a strict string match to a more flexible approach that checks for the presence of individual components. This allows the test to be more resilient to formatting changes in the extraOrigins value.

Also applies to: 72-72

🧰 Tools
🪛 GitHub Check: Build API

[failure] 22-22:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················

🪛 GitHub Check: Test API

[failure] 22-22:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················

🪛 GitHub Actions: CI - Main (API)

[error] 22-22: Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎··················· prettier/prettier

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: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between b078102 and 04f3b23.

📒 Files selected for processing (3)
  • api/dev/Unraid.net/myservers.cfg (1 hunks)
  • api/dev/states/myservers.cfg (2 hunks)
  • api/src/__test__/store/modules/config.test.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • api/dev/Unraid.net/myservers.cfg
  • api/dev/states/myservers.cfg
🧰 Additional context used
🪛 GitHub Check: Build API
api/src/__test__/store/modules/config.test.ts

[failure] 22-22:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················


[failure] 72-72:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················

🪛 GitHub Check: Test API
api/src/__test__/store/modules/config.test.ts

[failure] 22-22:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················


[failure] 72-72:
Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎···················

🪛 GitHub Actions: CI - Main (API)
api/src/__test__/store/modules/config.test.ts

[error] 22-22: Replace ·expect.stringContaining('https://google.com')·&&·expect.stringContaining('https://test.com')·&& with ⏎····················expect.stringContaining('https://google.com')·&&⏎····················expect.stringContaining('https://test.com')·&&⏎··················· prettier/prettier

⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Cloudflare Pages

Copy link
Member

@pujitm pujitm left a comment

Choose a reason for hiding this comment

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

lgtm, i like the config test changes as well, less flaky

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2025

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/1308/dynamix.unraid.net.plg

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

♻️ Duplicate comments (1)
unraid-ui/src/components/common/loading/index.ts (1)

2-2: ⚠️ Potential issue

Rename the Error import to avoid shadowing the global Error object.

The import on line 2 uses the name Error, which shadows JavaScript's built-in global Error object. This could lead to confusion or unexpected behavior in the codebase.

Consider this change:

-import Error from '@/components/common/loading/Error.vue';
+import LoadingError from '@/components/common/loading/Error.vue';

And update the export accordingly:

-export { Bar, Error, Spinner };
+export { Bar, LoadingError, Spinner };

Or alternatively, use a named import:

-import Error from '@/components/common/loading/Error.vue';
+import { default as LoadingError } from '@/components/common/loading/Error.vue';
🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

🧹 Nitpick comments (2)
api/src/__test__/store/modules/config.test.ts (2)

174-182: Consider using createConfigMatcher for consistency.

While this test correctly verifies the behavior, it directly checks state.api.extraOrigins instead of using the createConfigMatcher pattern used elsewhere.

- expect(state.api.extraOrigins).toBe(origins.join(', '));
+ expect(state).toMatchObject(
+     createConfigMatcher({
+         api: expect.objectContaining({
+             extraOrigins: origins.join(', '),
+         }),
+     })
+ );

184-192: Consider using createConfigMatcher for consistency.

Similar to the previous comment, this test could use the createConfigMatcher pattern for consistency with other tests.

- expect(state.remote.upnpEnabled).toBe('yes');
- expect(state.connectionStatus.upnpStatus).toBe('active');
+ expect(state).toMatchObject(
+     createConfigMatcher({
+         remote: expect.objectContaining({
+             upnpEnabled: 'yes',
+         }),
+         connectionStatus: expect.objectContaining({
+             upnpStatus: 'active',
+         }),
+     })
+ );
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro (Legacy)

📥 Commits

Reviewing files that changed from the base of the PR and between 5f6ec66 and 5375601.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (60)
  • .github/workflows/main.yml (1 hunks)
  • api/dev/Unraid.net/myservers.cfg (1 hunks)
  • api/dev/states/myservers.cfg (2 hunks)
  • api/src/__test__/store/modules/config.test.ts (3 hunks)
  • api/src/store/modules/config.ts (1 hunks)
  • unraid-ui/.eslintrc.js (0 hunks)
  • unraid-ui/eslint.config.ts (1 hunks)
  • unraid-ui/package.json (3 hunks)
  • unraid-ui/src/components/brand/BrandButton.vue (5 hunks)
  • unraid-ui/src/components/brand/BrandLoading.ce.vue (1 hunks)
  • unraid-ui/src/components/brand/BrandLogoConnect.vue (2 hunks)
  • unraid-ui/src/components/brand/brand-button.variants.ts (1 hunks)
  • unraid-ui/src/components/common/badge/Badge.vue (1 hunks)
  • unraid-ui/src/components/common/button/Button.test.ts (1 hunks)
  • unraid-ui/src/components/common/button/Button.vue (1 hunks)
  • unraid-ui/src/components/common/loading/Error.vue (3 hunks)
  • unraid-ui/src/components/common/loading/Spinner.vue (1 hunks)
  • unraid-ui/src/components/common/loading/index.ts (1 hunks)
  • unraid-ui/src/components/common/popover/PopoverTrigger.vue (1 hunks)
  • unraid-ui/src/components/common/popover/index.ts (1 hunks)
  • unraid-ui/src/components/common/scroll-area/ScrollArea.vue (1 hunks)
  • unraid-ui/src/components/common/scroll-area/index.ts (1 hunks)
  • unraid-ui/src/components/common/sheet/Sheet.vue (2 hunks)
  • unraid-ui/src/components/common/sheet/SheetContent.vue (1 hunks)
  • unraid-ui/src/components/common/sheet/SheetFooter.vue (1 hunks)
  • unraid-ui/src/components/common/sheet/SheetHeader.vue (1 hunks)
  • unraid-ui/src/components/common/sheet/index.ts (1 hunks)
  • unraid-ui/src/components/common/stepper/index.ts (1 hunks)
  • unraid-ui/src/components/common/tabs/index.ts (1 hunks)
  • unraid-ui/src/components/common/tooltip/index.ts (1 hunks)
  • unraid-ui/src/components/form/input/Input.vue (1 hunks)
  • unraid-ui/src/components/form/input/index.ts (1 hunks)
  • unraid-ui/src/components/form/label/index.ts (1 hunks)
  • unraid-ui/src/components/form/lightswitch/Lightswitch.vue (3 hunks)
  • unraid-ui/src/components/form/lightswitch/index.ts (1 hunks)
  • unraid-ui/src/components/form/select/index.ts (1 hunks)
  • unraid-ui/src/components/form/switch/index.ts (1 hunks)
  • unraid-ui/src/components/layout/PageContainer.vue (1 hunks)
  • unraid-ui/src/components/layout/index.ts (1 hunks)
  • unraid-ui/src/env.d.ts (1 hunks)
  • unraid-ui/src/forms/ControlLayout.vue (2 hunks)
  • unraid-ui/src/forms/NumberField.vue (1 hunks)
  • unraid-ui/src/forms/PreconditionsLabel.vue (1 hunks)
  • unraid-ui/src/forms/Select.vue (1 hunks)
  • unraid-ui/src/forms/StringArrayField.vue (3 hunks)
  • unraid-ui/src/forms/Switch.vue (2 hunks)
  • unraid-ui/src/forms/VerticalLayout.vue (2 hunks)
  • unraid-ui/src/forms/jsonforms.d.ts (1 hunks)
  • unraid-ui/src/forms/renderer-entries.ts (1 hunks)
  • unraid-ui/src/forms/renderers.ts (1 hunks)
  • unraid-ui/src/forms/vertical-layout.renderer.ts (1 hunks)
  • unraid-ui/src/index.ts (1 hunks)
  • unraid-ui/src/register.ts (1 hunks)
  • unraid-ui/src/theme/preset.ts (1 hunks)
  • unraid-ui/src/types/badge.ts (1 hunks)
  • unraid-ui/src/types/components.d.ts (0 hunks)
  • unraid-ui/tsconfig.app.json (0 hunks)
  • unraid-ui/tsconfig.json (2 hunks)
  • unraid-ui/tsconfig.node.json (1 hunks)
  • unraid-ui/tsconfig.test.json (0 hunks)
💤 Files with no reviewable changes (4)
  • unraid-ui/tsconfig.test.json
  • unraid-ui/.eslintrc.js
  • unraid-ui/tsconfig.app.json
  • unraid-ui/src/types/components.d.ts
✅ Files skipped from review due to trivial changes (1)
  • unraid-ui/src/forms/Switch.vue
🚧 Files skipped from review as they are similar to previous changes (51)
  • unraid-ui/src/components/form/input/index.ts
  • unraid-ui/src/components/form/label/index.ts
  • unraid-ui/src/components/form/switch/index.ts
  • unraid-ui/src/index.ts
  • unraid-ui/src/components/common/scroll-area/index.ts
  • unraid-ui/tsconfig.node.json
  • unraid-ui/src/components/common/tooltip/index.ts
  • unraid-ui/src/components/common/popover/PopoverTrigger.vue
  • unraid-ui/src/types/badge.ts
  • unraid-ui/src/register.ts
  • unraid-ui/src/components/common/tabs/index.ts
  • unraid-ui/src/forms/vertical-layout.renderer.ts
  • unraid-ui/src/components/common/sheet/index.ts
  • unraid-ui/src/forms/jsonforms.d.ts
  • unraid-ui/src/components/common/button/Button.test.ts
  • unraid-ui/src/theme/preset.ts
  • unraid-ui/src/components/brand/BrandLogoConnect.vue
  • unraid-ui/src/forms/StringArrayField.vue
  • unraid-ui/src/components/common/popover/index.ts
  • unraid-ui/src/forms/PreconditionsLabel.vue
  • unraid-ui/src/components/common/scroll-area/ScrollArea.vue
  • unraid-ui/src/components/form/input/Input.vue
  • unraid-ui/src/components/common/button/Button.vue
  • unraid-ui/src/components/layout/PageContainer.vue
  • unraid-ui/src/components/common/sheet/SheetFooter.vue
  • unraid-ui/src/forms/ControlLayout.vue
  • unraid-ui/src/components/common/badge/Badge.vue
  • unraid-ui/src/components/form/lightswitch/index.ts
  • unraid-ui/src/components/brand/brand-button.variants.ts
  • unraid-ui/src/components/common/sheet/SheetHeader.vue
  • unraid-ui/src/components/layout/index.ts
  • unraid-ui/src/components/form/select/index.ts
  • unraid-ui/src/forms/NumberField.vue
  • api/dev/Unraid.net/myservers.cfg
  • unraid-ui/src/components/common/loading/Spinner.vue
  • unraid-ui/src/forms/Select.vue
  • unraid-ui/src/components/common/stepper/index.ts
  • unraid-ui/src/components/form/lightswitch/Lightswitch.vue
  • api/src/store/modules/config.ts
  • .github/workflows/main.yml
  • unraid-ui/src/components/common/sheet/Sheet.vue
  • unraid-ui/src/forms/renderer-entries.ts
  • unraid-ui/src/forms/renderers.ts
  • unraid-ui/src/components/brand/BrandLoading.ce.vue
  • unraid-ui/src/forms/VerticalLayout.vue
  • unraid-ui/src/components/common/loading/Error.vue
  • unraid-ui/src/components/brand/BrandButton.vue
  • unraid-ui/eslint.config.ts
  • unraid-ui/package.json
  • unraid-ui/src/components/common/sheet/SheetContent.vue
  • api/dev/states/myservers.cfg
🧰 Additional context used
🧠 Learnings (1)
unraid-ui/src/components/common/loading/index.ts (2)
Learnt from: elibosley
PR: unraid/api#974
File: web/components/Loading/Error.vue:1-3
Timestamp: 2025-04-03T15:36:22.993Z
Learning: In Nuxt.js projects, components are automatically imported, so explicit import statements for components like `LoadingSpinner` in `web/components/Loading/Error.vue` are not necessary.
Learnt from: pujitm
PR: unraid/api#974
File: web/components/Loading/Error.vue:50-50
Timestamp: 2025-04-03T15:36:12.902Z
Learning: In this project, the `Button` component from `~/components/shadcn/Button.vue` is autoloaded and does not need to be imported manually in components like `web/components/Loading/Error.vue`.
🪛 Biome (1.9.4)
unraid-ui/src/components/common/loading/index.ts

[error] 2-2: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build and Deploy Plugin / Build and Deploy Plugin
  • GitHub Check: Cloudflare Pages
🔇 Additional comments (18)
unraid-ui/src/env.d.ts (2)

3-7: Improved type safety for Vue component declarations.

The updated module declaration for .vue files uses more precise TypeScript types:

  • Changed from using empty objects and any to more specific Record<string, never> and unknown
  • Added explicit default export statement to match Vue's component pattern
  • Quote style updated for consistency with linting rules

These changes improve type safety by eliminating the use of any type and making the declaration more explicit.


9-13: Good addition of custom element Vue declaration.

Adding support for .ce.vue files indicates the project is using Vue custom elements (Web Components). The declaration correctly:

  • Uses the same improved type safety as regular Vue components
  • Includes the explicit default export
  • Follows the same pattern as the standard Vue declaration

This addition ensures proper TypeScript support for custom element components.

unraid-ui/tsconfig.json (5)

3-17: Enhanced Compiler Options
The new compiler options enforce stricter type checks and leverage modern JavaScript/TypeScript features. These settings (e.g., "target": "ES2020", "module": "ESNext", "strict": true) contribute to improved code safety and consistency.


18-27: Refined Path Mappings
Updating the path mappings (especially lines 21–23) to explicitly declare "@/components/*", "@/lib/*", and "@/types/*" improves module resolution clarity and helps maintain a scalable project structure.


28-35: Updated Types Array
Adding a comprehensive list of types (including vite/client, vitest/globals, node, happy-dom, etc.) ensures better type support for various environments and testing utilities, thereby enhancing the overall development experience.


44-47: Expanded Files Inclusion
Including additional configuration files such as "tailwind.config.ts", "**/*.config.ts", and "eslint.config.ts" in the include array ensures that all relevant configuration files are properly type-checked, aligning the setup with modern monorepo and configuration management practices.


1-2: Consolidated Configuration
The removal of inherited settings (e.g., the removal of "extends": "./tsconfig.app.json") in favor of explicit configuration enhances clarity. Just ensure any project-level overrides previously provided by the extended file are now integrated as needed.

Also applies to: 37-38

unraid-ui/src/components/common/loading/index.ts (1)

1-3: Improved import path structure but a naming issue remains.

The change from relative to absolute imports (@/components/...) improves consistency and maintainability. This approach makes it easier to relocate files without breaking import paths and aligns with modern best practices for module imports.

However, there's still an important issue with the naming of the Error import.

🧰 Tools
🪛 Biome (1.9.4)

[error] 2-2: Do not shadow the global "Error" property.

Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.

(lint/suspicious/noShadowRestrictedNames)

api/src/__test__/store/modules/config.test.ts (10)

1-32: Well-structured mock setup for testing.

The addition of mock functions for pubsub, GraphQLClient, and ping-timeout-jobs provides proper isolation for the tests and allows for verifying interactions with these dependencies.


33-71: Good abstraction with the createConfigMatcher helper.

The createConfigMatcher function is an excellent abstraction that makes the tests more maintainable and consistent. It provides a standard structure for validating config state while allowing specific values to be overridden as needed.


86-86: Good refactoring to use the new matcher.

Updating the existing tests to use the new createConfigMatcher function improves consistency across all tests.


103-109: Good use of the matcher with specific overrides.

The test properly uses the createConfigMatcher with specific overrides to verify only the changed parts of the state.


112-137: Good test coverage for loginUser functionality.

The test verifies both the state changes and the side effects (pubsub publications) of the loginUser function.


139-154: Complete test for logoutUser side effects.

This test thoroughly verifies all the side effects of the logoutUser function, including pubsub publications, stopping timeout jobs, and clearing the GraphQLClient instance.


156-172: Good test for token updates.

The test verifies that the updateAccessTokens function correctly updates all the token fields in the state.


194-201: Good test coverage for various config functions.

The tests for setWanPortToValue, setWanAccess, addSsoUser, removeSsoUser, and setLocalApiKey thoroughly verify the behavior of these functions.

Also applies to: 203-210, 212-242, 244-260


262-267: Good test for GraphQL connection status updates.

The test verifies that the setGraphqlConnectionStatus function correctly updates the minigraph status in the state.


269-284: Comprehensive test for remote access thunk.

This test verifies that the setupRemoteAccessThunk.fulfilled action correctly updates all the relevant remote access settings in the state.

@elibosley elibosley merged commit da8dac3 into main Apr 3, 2025
9 checks passed
@elibosley elibosley deleted the chore/uui-linter branch April 3, 2025 19:31
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