Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

chore: update deps #53

Closed
wants to merge 1 commit into from
Closed

chore: update deps #53

wants to merge 1 commit into from

Conversation

Skiyee
Copy link
Member

@Skiyee Skiyee commented Aug 7, 2024

fixed: #49
fixed: #51

更新:
Vue 更新至 v3.4+
Eslint 更新至 v9.8+
Vite 更新至 v5.2.8
Typescript 保持 v5.4.5

加入:
scss - CSS预处理器
taze - 依赖管理器

移除:
pnpm版本管理

Summary by CodeRabbit

  • New Features

    • Implemented stricter ESLint rules for improved code quality.
    • Updated TypeScript configuration for enhanced compatibility and support for modern JavaScript features.
    • Enhanced Vite configuration for better performance and module resolution.
  • Bug Fixes

    • Eliminated unused ESLint configurations to streamline code standards.
  • Chores

    • Updated dependencies to more stable versions for improved functionality and security across the project.

Copy link

coderabbitai bot commented Aug 7, 2024

Walkthrough

The recent changes enhance the project's linting and TypeScript configurations, emphasizing stricter adherence to ESLint rules and improving TypeScript support for Vue components. Key updates include the removal of experimental features, streamlined ESLint configurations, and dependency upgrades for better stability. The overall goal is to refine development practices, enhance performance, and streamline the project for modern JavaScript capabilities.

Changes

Files Change Summary
.vscode/settings.json Updated ESLint settings, disabled default formatter, removed custom rules, added TypeScript SDK path.
eslint.config.js Simplified exports by removing unused imports and enabling unocss directly in config.
package.json Updated dependencies to stable versions, removed package manager specification.
src/auto-imports.d.ts, src/shims.d.ts Modified TypeScript interfaces, reduced properties for better maintainability.
src/uni-pages.d.ts Removed export from NavigateToOptions and SwitchTabOptions interfaces.
tsconfig.json Enhanced TypeScript options for better compatibility with Vue and Vite, added new libraries.
vite.config.ts Transitioned to asynchronous configuration, improved module resolution, updated build targets.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant VSCODE as VS Code
    participant ESLint
    participant TypeScript
    participant Vite

    Developer->>VSCODE: Edit code
    VSCODE->>ESLint: Trigger linting on save
    ESLint-->>VSCODE: Return linting results
    VSCODE->>TypeScript: Compile code
    TypeScript-->>VSCODE: Return compilation results
    VSCODE->>Vite: Build project
    Vite-->>Developer: Serve application
Loading

Assessment against linked issues

Objective Addressed Explanation
Address native tag errors in components (#49) It's unclear if the changes resolve the reported type errors.
Ensure ESLint rules are effective (#51)

🐰 In the meadow, changes bloom bright,
ESLint and TypeScript take flight!
With settings refined and rules now tight,
Code flows like dreams in the soft moonlight.
Hoppity hop, let the coding delight! 🐇✨


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

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (invoked as PR comments)

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

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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

@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

Outside diff range, codebase verification and nitpick comments (1)
src/auto-imports.d.ts (1)

317-317: Document the purpose of the empty GlobalComponents interface.

The GlobalComponents interface is currently empty. Consider adding a comment to explain its intended use or purpose.

+  // Placeholder for future global component declarations
  interface GlobalComponents {}
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 1d6dada and c6c2c49.

Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing (8)
  • .vscode/settings.json (2 hunks)
  • eslint.config.js (1 hunks)
  • package.json (2 hunks)
  • src/auto-imports.d.ts (8 hunks)
  • src/shims.d.ts (1 hunks)
  • src/uni-pages.d.ts (1 hunks)
  • tsconfig.json (1 hunks)
  • vite.config.ts (1 hunks)
Files skipped from review due to trivial changes (1)
  • eslint.config.js
Additional comments not posted (26)
src/shims.d.ts (2)

7-9: LGTM!

The introduction of type alias A that imports GlobalComponents from @vue/runtime-core enhances type safety and integration with Vue's component system.


10-12: LGTM!

Extending the GlobalComponents interface with the newly defined type A improves type inference and autocompletion in development environments.

.vscode/settings.json (3)

2-5: LGTM!

Setting the file associations for pages.json and manifest.json to jsonc ensures that these files are treated as JSON with comments, improving readability and maintainability.


9-10: LGTM!

Changing editor.codeActionsOnSave settings to focus on explicit ESLint fixes (source.fixAll.eslint) and reducing automatic corrections (source.fixAll) can lead to more controlled and intentional code formatting.


25-25: LGTM!

Adding the TypeScript SDK path (typescript.tsdk) indicates a focus on TypeScript development, ensuring the correct TypeScript version is used.

src/uni-pages.d.ts (2)

12-12: Verify the impact of removing the export keyword.

Removing the export keyword from the SwitchTabOptions interface makes it inaccessible to other modules. Ensure that this change does not break any external code that relies on this interface.

Verification successful

No external dependencies on SwitchTabOptions interface found.

The SwitchTabOptions interface is used internally within src/uni-pages.d.ts and is not imported or used in other files. Removing the export keyword does not appear to break any external code.

  • src/uni-pages.d.ts: Internal usage of SwitchTabOptions confirmed.
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the `SwitchTabOptions` interface is used in other modules.

# Test: Search for the usage of `SwitchTabOptions`. Expect: No broken imports.
rg --type typescript -A 5 $'SwitchTabOptions'

Length of output: 79


Script:

#!/bin/bash
# Description: Verify if the `SwitchTabOptions` interface is used in other modules.

# Test: Search for the usage of `SwitchTabOptions`. Expect: No broken imports.
rg --type ts -A 5 'SwitchTabOptions'

Length of output: 702


6-9: Verify the impact of removing the export keyword.

Removing the export keyword from the NavigateToOptions interface makes it inaccessible to other modules. Ensure that this change does not break any external code that relies on this interface.

Verification successful

Verify the impact of removing the export keyword.

Removing the export keyword from the NavigateToOptions interface makes it inaccessible to other modules. Ensure that this change does not break any external code that relies on this interface.


Verify the impact of removing the export keyword.

Removing the export keyword from the NavigateToOptions interface does not impact external modules, as the interface is only used within the same file. However, ensure that this change does not affect the internal usage within src/uni-pages.d.ts.

  • Location:
    • src/uni-pages.d.ts
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if the `NavigateToOptions` interface is used in other modules.

# Test: Search for the usage of `NavigateToOptions`. Expect: No broken imports.
rg --type typescript -A 5 $'NavigateToOptions'

Length of output: 80


Script:

#!/bin/bash
# Description: Verify if the `NavigateToOptions` interface is used in other modules.

# Test: Search for the usage of `NavigateToOptions`. Expect: No broken imports.
rg --glob '*.ts' -A 5 $'NavigateToOptions'

Length of output: 955

tsconfig.json (10)

4-4: Set target to ESNext

Setting the target to ESNext is appropriate for modern JavaScript development, ensuring access to the latest ECMAScript features.


5-6: Configure JSX options for Vue

The jsx option set to preserve and jsxImportSource set to vue are correct configurations for using JSX with Vue 3.


7-7: Expand lib array

Including DOM, DOM.Iterable, and ESNext in the lib array broadens the available JavaScript features, which is beneficial for a modern web project.


8-9: Enable useDefineForClassFields and set module to ESNext

These options enhance class field definitions and module handling, aligning with modern JavaScript standards.


10-10: Set moduleResolution to bundler

Using bundler for moduleResolution is suitable for projects using Vite, as it optimizes module resolution for bundling.


14-14: Enable resolveJsonModule

Allowing the import of JSON files as modules is a useful feature for many projects.


15-22: Update types array

Including vite/client, @dcloudio/types, and @uni-helper/uni-types improves TypeScript type definitions for uni-app components and Vite.


23-29: Enable strict type checking and consistency options

Enabling strict, noImplicitThis, esModuleInterop, forceConsistentCasingInFileNames, verbatimModuleSyntax, and skipLibCheck promotes stricter type checking and consistency across the codebase.


31-37: Expand include section

Including **/*.d.ts, src/**/*.ts, src/**/*.tsx, src/**/*.jsx, and src/**/*.vue ensures comprehensive type checking for all relevant file types in the project.


39-39: Integrate @uni-helper/uni-types/volar-plugin

Integrating this plugin enhances the development experience and tooling support for the project.

vite.config.ts (6)

1-1: Import URL and fileURLToPath from node:url

These imports are necessary for resolving file paths in the configuration.


12-14: Restructure configuration export to an asynchronous function

Wrapping the configuration export in an asynchronous function allows for dynamic imports, improving initial load times.


16-20: Add resolve property with alias setup

Mapping the @ symbol to the ./src directory enhances module resolution and makes imports cleaner and more manageable.


21-46: Maintain existing plugins and add dynamic import for UnoCSS

The plugins array remains largely unchanged, but the dynamic import for UnoCSS improves the configuration by deferring the import until necessary.


47-50: Add build property with target settings

Setting the target JavaScript version to es6 and the CSS target to chrome61 focuses on modern browser compatibility.


51-53: Add optimizeDeps property to exclude vue-demi

Explicitly excluding vue-demi from optimizeDeps is relevant for dependency management in a mixed Vue 2 and Vue 3 environment.

package.json (2)

47-64: Update dependencies to more recent versions

The updates to @dcloudio/uni-app, @dcloudio/uni-app-plus, @dcloudio/uni-components, @dcloudio/uni-h5, @dcloudio/uni-mp-*, @uni-helper/uni-use, @vueuse/core, vue, and vue-i18n reflect a shift to more stable and recent versions, enhancing functionality and compatibility.


67-95: Update devDependencies to more recent versions

The updates to @dcloudio/types, @dcloudio/uni-*, @uni-helper/*, @iconify-json/carbon, @types/node, @vue/runtime-core, @vue/tsconfig, eslint, lint-staged, sass, simple-git-hooks, taze, typescript, unocss, unplugin-auto-import, vite, and vue-tsc reflect a commitment to maintaining modern coding standards and practices, improving the development workflow and tooling.

src/auto-imports.d.ts (1)

318-318: Verify the impact of removing properties from ComponentCustomProperties.

Several properties have been removed from the ComponentCustomProperties interface. Ensure that these changes do not break existing functionality and update the documentation accordingly.

Verification successful

Verified: The removal of properties from ComponentCustomProperties does not impact the existing codebase.

The removed properties were found only in src/auto-imports.d.ts and not used elsewhere in the codebase. Ensure that the documentation is updated to reflect these changes.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the impact of removing properties from `ComponentCustomProperties`.

# Test: Search for the usage of the removed properties. Expect: No occurrences of the removed properties.
rg --type js --type ts --type vue 'createReusableTemplate|injectLocal|provideLocal|useAnimate|useArrayIncludes|useClipboardItems|useParentElement|usePerformanceObserver'

Length of output: 199


Script:

#!/bin/bash
# Description: Verify the impact of removing properties from `ComponentCustomProperties`.

# Test: Search for the usage of the removed properties in .js, .ts, and .vue files. Expect: No occurrences of the removed properties.

# Search within .js and .ts files
rg --type js --type ts 'createReusableTemplate|injectLocal|provideLocal|useAnimate|useArrayIncludes|useClipboardItems|useParentElement|usePerformanceObserver'

# Search within .vue files
fd -e vue -x rg 'createReusableTemplate|injectLocal|provideLocal|useAnimate|useArrayIncludes|useClipboardItems|useParentElement|usePerformanceObserver' {}

Length of output: 1099

@Skiyee
Copy link
Member Author

Skiyee commented Aug 8, 2024

@ModyQyW 大哥,look look?

@Skiyee
Copy link
Member Author

Skiyee commented Aug 9, 2024

由于 ci 不通过而关闭,若有时间再提交新 PR

@Skiyee Skiyee closed this Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eslint不生效 view、button等原生标签报错
1 participant