-
Couldn't load subscription status.
- Fork 11
chore: add linter to unraid ui and simplify tsconfigs #1308
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
Conversation
WalkthroughThis 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
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
Suggested reviewers
Poem
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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 AlignmentThe 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@appalias to avoid resolution issues.
13-19: Review: Inconsistent Default Shared CSS PathWithin the
registerAllComponentsfunction, the default forpathToSharedCssis 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 wellThe
vue/no-unused-propertiesrule 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 patternsYou'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 constraintsYour 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 patternsThe 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
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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.1The 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 extraOriginsAdded a space after the comma in extraOrigins for better readability.
8-8: WAN port setting emptiedThe 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 enabledUPnP 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 extraOriginsAdded a space after the comma in extraOrigins for better readability.
8-8: WAN port setting emptiedThe 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 enabledUPnP 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 configurationThe allowedOrigins list appears unchanged in content but may have been reformatted.
24-24: UPnP status updated with success messageThe 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 bothScrollAreaandScrollBarensures 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": truealongside"composite": truecan 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.jsonBased on the intended check for a composite setup, please ensure that the use of
"noEmit": trueis indeed deliberate when"composite": trueis (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
noEmitand Composite Options
- Verify that the inclusion of
"noEmit": truealongside 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 AchievedThe 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 UsageThe 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 DelimitersChanging 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 PathsSwitching 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 StepThe 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 ConfigurationThe 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.vueimproves consistency and clarity. Please ensure that your TypeScript configuration (e.g.tsconfig.json) includes the correct path mappings for the@appalias.
5-8: Export Object Remains Consistent.
The exportedverticalLayoutEntrycorrectly 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 (likecustom-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 forvanillaRenderershas 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-entriesis 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-entriesis currently triggering TS2307 ("Cannot find module '@app/forms/renderer-entries'"). Please confirm that your TypeScript configuration (e.g., the"paths"mapping intsconfig.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.tsexists, but the TS alias for@app/*wasn't found in atsconfig.jsonat the repository root. Please ensure one of the following:
- If a
tsconfig.jsonwith the"paths"mapping for"@app/*"exists in a subdirectory (e.g., underunraid-ui), confirm that your build and IDE configurations reference it correctly.- Otherwise, add or update the
tsconfig.jsonat 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 safetyThe change from
anytounknownand usingRecord<string, never>for empty objects improves type safety and follows TypeScript best practices.
9-13: Consistent module declaration for custom elementsAdding 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 cleaningReplacing
rm -rfwithrimrafmakes the clean script work across different operating systems including Windows.unraid-ui/tsconfig.json (2)
3-17: Good compiler options for modern TypeScriptThe 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@appas 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 inunraid-ui/tsconfig.json) defines path aliases using@/*, while the ESLint configuration (via the no-relative-import-paths rule) appears to expect the@appprefix. This misalignment can lead to confusion or errors when resolving module imports.Next Steps:
Manual Verification:
Since the initial automated search (targeting a presumedsrc/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 intsconfig.json, or- The TypeScript path mappings to use
@appif that is the intended convention.Please review the ESLint configuration files (e.g.,
.eslintrc.jsor similar) to locate references to@appand ensure they align with the path mappings intsconfig.json.
fe4a77c to
465ea1d
Compare
There was a problem hiding this 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 issueRename the Error import to avoid shadowing the global Error object.
The import name
Errorshadows the built-in JavaScriptErrorobject, which could lead to confusion or bugs. Consider renaming it to something likeLoadingError.-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
classproperty 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)
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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 anytype 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
withDefaultsfunction and the optionaldescriptionproperty. 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 pathThe 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 addedThe
computedimport from Vue has been explicitly added. This ensures the dependency is properly tracked and improves code clarity.
16-17: Type safety improvement: any → unknownReplacing
anywithunknownfor theiconandiconRightproperties improves type safety. Theunknowntype requires type checking before use, unlikeanywhich bypasses type checking.
46-49: Improved formatting for cn function callThe 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 renderingThe icon component rendering has been reformatted to a single line, improving code consistency without changing functionality.
90-91: Reformatted conditional class assignmentThe conditional class assignment for
iconRightHoverDisplayhas been reformatted to improve readability while maintaining the same logic.unraid-ui/tsconfig.json (5)
3-17: Comprehensive TypeScript configuration updateThe 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 mappingsMore 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 definitionsType 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 patternsThe 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 structureThe 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
There was a problem hiding this 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)
📒 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
extraOriginsvalue.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
There was a problem hiding this 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)
📒 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
There was a problem hiding this 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
5e60db5 to
5375601
Compare
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
There was a problem hiding this 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 issueRename 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 globalErrorobject. 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)
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis 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
.vuefiles uses more precise TypeScript types:
- Changed from using empty objects and
anyto more specificRecord<string, never>andunknown- 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
anytype and making the declaration more explicit.
9-13: Good addition of custom element Vue declaration.Adding support for
.ce.vuefiles 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 (includingvite/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 theincludearray 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
createConfigMatcherfunction 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
createConfigMatcherfunction 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.
Summary by CodeRabbit
Chores
Style