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

ci(biome): migrate from ESLint to Biome #142

Merged
merged 6 commits into from
Aug 19, 2024

Conversation

ivangabriele
Copy link
Owner

@ivangabriele ivangabriele commented Jun 23, 2024

Description

Migrate to Biome to simplify linting config and drastically speed up JS/TS linting processes.

Checklist

  • I updated the documentation accordingly. Or I don't need to.
  • I updated the tests accordingly. Or I don't need to.

@codecov-commenter
Copy link

codecov-commenter commented Jun 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 37.93%. Comparing base (ef4820d) to head (a6516a5).
Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #142   +/-   ##
=======================================
  Coverage   37.93%   37.93%           
=======================================
  Files          18       18           
  Lines         493      493           
  Branches        2        2           
=======================================
  Hits          187      187           
  Misses        306      306           
Flag Coverage Δ
core 38.59% <ø> (ø)
webview 25.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

coderabbitai bot commented Jun 23, 2024

Walkthrough

This comprehensive update refines configurations, improves code consistency and readability, and aligns components with modern JavaScript/TypeScript practices. Key enhancements include new settings for the Biome tool, updates to import paths, and simplifications in component structures and event handling.

Changes

File(s) Change Summary
biome.jsonc Added configuration for the Biome tool, specifying schema, linter, and file handling preferences.
configs/jest.config.js Removed ESLint directive for default exports, promoting named exports.
configs/wdio.config.ts Updated imports to use 'node:child_process', adjusted types, and removed a lint directive.
e2e/start.spec.ts Introduced Jest global imports, modified test setups, and removed a lint directive for function naming.
scripts/dev/post_install.js Enhanced error handling to use _err and provided a warning for missing ggshield.
scripts/print_clamav_version.js Replaced console.log with a Biome ignore directive for linting purposes.
src/App.tsx Updated enum constant casing to PascalCase, affecting rendering behavior.
src/components/FileExplorer/Node.tsx, src/components/FileExplorer/index.tsx Refined imports and function syntax for better consistency and readability.
src/components/Toaster.tsx Reordered imports, replaced Infinity with Number.POSITIVE_INFINITY, and standardized arrow function syntax.
src/constants.ts Renamed Page enum values to PascalCase with specific numeric assignments.
src/elements/Logger.tsx Optimized UnmemoizedLogger component functionality and updated effect dependencies.
src/hooks/tests/useForceUpdate.test.tsx, src/hooks/useForceUpdate.ts Added Jest global imports, implemented @ts-ignore comments, and refined hook usage.
src/index.tsx Reordered imports and updated ReactDOM usage to reactDom with new root creation.
src/layouts/MainMenu/Button.tsx, src/layouts/MainMenu/index.tsx Standardized arrow function syntax for inline styles and updated page names and attributes.
src/layouts/Screen.tsx Explicitly set $isLoading prop in the Box component for conditional rendering.
src/screens/Cloud.tsx, src/screens/Dashboard.tsx, src/screens/Scanner.tsx Simplified components by removing props, improved event handling, and ensured consistent arrow function usage.
vite.config.ts Adjusted minification settings based on the TAURI_DEBUG environment variable, removing outdated default export comments.

Tips

Chat

There are 3 ways to chat with CodeRabbit:

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

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

CodeRabbit Commands (Invoked using PR comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title 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.

@ivangabriele ivangabriele changed the title lint(biome): migrate from ESLint to Biome ci(biome): migrate from ESLint to Biome Jun 23, 2024
@ivangabriele ivangabriele force-pushed the ivan/lint-biome-migrate-from-eslint-to-biome branch from 61edcf3 to 08dc55f Compare June 23, 2024 23:58
@ivangabriele ivangabriele force-pushed the ivan/lint-biome-migrate-from-eslint-to-biome branch from 08dc55f to d0a7584 Compare June 23, 2024 23:58
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: 16

@ivangabriele
Copy link
Owner Author

@coderabbitai full review

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

scripts/print_clamav_version.js Outdated Show resolved Hide resolved
e2e/start.spec.ts Outdated Show resolved Hide resolved
src/layouts/MainMenu/index.tsx Show resolved Hide resolved
src/layouts/MainMenu/index.tsx Show resolved Hide resolved
src/layouts/MainMenu/index.tsx Show resolved Hide resolved
src/layouts/MainMenu/index.tsx Show resolved Hide resolved
src/index.tsx Show resolved Hide resolved
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: 5

src/hooks/__tests__/useForceUpdate.test.tsx Outdated Show resolved Hide resolved
src/screens/Dashboard.tsx Show resolved Hide resolved
configs/jest.config.js Outdated Show resolved Hide resolved
vite.config.ts Outdated Show resolved Hide resolved
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: 7

src/layouts/MainMenu/index.tsx Show resolved Hide resolved
src/index.tsx Show resolved Hide resolved
src/hooks/__tests__/useForceUpdate.test.tsx Outdated Show resolved Hide resolved
src/hooks/__tests__/useForceUpdate.test.tsx Outdated Show resolved Hide resolved
src/components/FileExplorer/Node.tsx Show resolved Hide resolved
src/screens/Settings/index.tsx Show resolved Hide resolved
src/screens/Scanner.tsx Show resolved Hide resolved
coderabbitai[bot]
coderabbitai bot previously approved these changes Aug 19, 2024
@ivangabriele ivangabriele merged commit 063e5bd into main Aug 19, 2024
16 checks passed
@ivangabriele ivangabriele deleted the ivan/lint-biome-migrate-from-eslint-to-biome branch August 19, 2024 21:15
@ivangabriele ivangabriele added this to the v0.4 milestone Aug 29, 2024
@ivangabriele ivangabriele added the internal Internal issues and tasks. No direct impact on end-user. label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Internal issues and tasks. No direct impact on end-user.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants