Skip to content

Update @antfu/eslint-config #72

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

Merged
merged 1 commit into from
Dec 27, 2023
Merged

Update @antfu/eslint-config #72

merged 1 commit into from
Dec 27, 2023

Conversation

Demivan
Copy link
Member

@Demivan Demivan commented Dec 27, 2023

Update eslint config

Copy link

coderabbitai bot commented Dec 27, 2023

Walkthrough

The updates across various files reflect a shift in variable management within a Vue component, alterations in string templates for localization, a minor text change in test descriptions, and a tweak in error handling for a test suite. Additionally, there's an update to the ESLint configuration to adopt a new rule set and adjust a specific rule preference, alongside a logical enhancement in the loader query function for better custom block handling.

Changes

Files Change Summary
__tests__/.../external.setup.vue Introduced userName variable; removed test variable.
__tests__/.../noLocale.vue
__tests__/.../test.vue
Modified fluent string templates for gender neutrality and possessive pronouns.
__tests__/.../errors.spec.ts Changed test suite description case from "Error checking" to "error checking."
__tests__/.../sfc.spec.ts Fixed syntax error with an extra parenthesis and comma.
eslint.config.js Added @antfu/eslint-config package; disabled 'test/prefer-lowercase-title' rule.
src/loader-query.ts Enhanced isCustomBlock function with additional condition for 'vue' property.

🐇✨
In the code's burrow, deep and vast,
Changes hop through files so fast.
A rabbit's touch, with care so true,
Refactors code, makes it anew. 🌟


<!-- walkthrough_end --><!-- This is an auto-generated comment: raw summary by coderabbit.ai -->
<!--


__tests__/fixtures/components/external.setup.vue: The semantic difference in the given unidiff snippet involves the introduction of a new variable `userName` within the `<script setup>` block and the removal of the `test` variable from the same block. This change affects the data flow and variable usage within the component.

__tests__/fixtures/noLocale.vue: The semantic difference in the given unidiff snippet involves a modification in the fluent string template related to shared photos, specifically in the gender-neutral form.

__tests__/fixtures/test.vue: The semantic difference in the given unidiff snippet involves a change in the content of a fluent string, specifically in the text related to possessive pronouns. The logic and control flow remain unaffected.

__tests__/frameworks/vite/errors.spec.ts: The semantic difference in the provided unidiff snippet involves a change in the description of a test suite from "Error checking" to "error checking."

__tests__/frameworks/webpack/sfc.spec.ts: The change introduces an additional closing parenthesis and comma within the `expect` statement, affecting the control flow and error handling in the `Webpack SFC` test suite.

eslint.config.js: The `eslint.config.js` file introduces a configuration for ESLint using the `@antfu/eslint-config` package, with a specific rule modification to disable `'test/prefer-lowercase-title'`.

src/loader-query.ts: The logic in the `isCustomBlock` function in `src/loader-query.ts` was modified to include an additional condition for the 'vue' property in the query object. The logical OR condition was adjusted to include `query.type === options.blockType` and `query.blockType === options.blockType` for webpack (vue-loader).

-->
<!-- end of auto-generated comment: raw summary by coderabbit.ai --><!-- This is an auto-generated comment: short summary by coderabbit.ai -->
<!--


### PR Objectives

The primary objective of this pull request, titled "Update @antfu/eslint-config," is to update the ESLint configuration within the project by integrating the `@antfu/eslint-config` package. This update is likely aimed at enhancing code quality and ensuring consistency in coding styles across the project. The pull request, numbered 72, does not explicitly link to any issues, but the changes suggest a focus on refining code standards, updating test descriptions, and modifying component behavior and test configurations.

The changes span across various test fixtures and configuration files, indicating an effort to align the project's code with the rules and standards defined by the newly introduced ESLint configuration. The modifications include variable changes in Vue component scripts, updates to string templates for localization, adjustments in test suite descriptions, and corrections in test expectations. Additionally, the configuration file for ESLint itself has been updated to disable a specific rule, which suggests a tailored approach to linting that fits the project's needs.

### AI-Generated Summary of Generated Summaries

The pull request introduces several updates to the project's codebase, primarily focusing on code quality and testing. Key changes include:

- In the Vue component tests, there is a notable variable update where a new `userName` variable is introduced, and an existing `test` variable is removed, indicating a shift in the component's data handling.
- String templates in Vue files have been updated for gender-neutral language and possessive pronouns, reflecting an effort to improve localization and inclusivity in the user interface.
- A minor change in test suite descriptions has been made, altering the capitalization for consistency and clarity in the test output.
- The test configurations have been refined with a syntax correction in the `Webpack SFC` test suite, which could affect how test results are interpreted.
- The ESLint configuration file has been updated to include the `@antfu/eslint-config` package, with a specific rule (`'test/prefer-lowercase-title'`) being disabled, suggesting a customized linting approach.
- The logic within the `isCustomBlock` function has been enhanced to include additional conditions for better handling of custom blocks in Vue components when using webpack (vue-loader).

These changes collectively aim to improve the maintainability of the code, enhance the clarity and inclusivity of user-facing text, and ensure that the project's coding standards are up-to-date with the latest practices.

-->
<!-- end of auto-generated comment: short summary by coderabbit.ai --><!-- commit_ids_reviewed_start -->

<!-- 57701f582b15b6ab36045129117f182d432ca41f -->

<!-- commit_ids_reviewed_end --><!-- tweet_start -->

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?

<details>
<summary>Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<!-- tweet_end --><!-- tips_start -->

---

<details>
<summary>Tips</summary>

### Chat with CodeRabbit Bot (`@coderabbitai`)

- You can directly reply to a review comment made by CodeRabbit. Example:
	- `I pushed a fix in commit <commit_id>.`
	- `Generate unit-tests for this file.`
- You can tag CodeRabbit on specific lines of code or entire files in the PR by tagging `@coderabbitai` in a comment. Examples:
	- `@coderabbitai generate unit tests for this file`
	-	`@coderabbitai modularize this function`
- You can tag `@coderabbitai` in a PR comment and ask questions about the PR and the codebase. Examples:
	- `@coderabbitai gather interesting statistics about this repository and render them in a table.`
	- `@coderabbitai show all the console.log statements in this repository.`
	- `@coderabbitai generate unit tests for the src/utils.ts file.`

### 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 a review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai help` to get help.


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

### CodeRabbit Configration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json).
- 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/coderabbit-overrides.v2.json`

### CodeRabbit Discord Community

Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback.

</details>

<!-- tips_end -->

Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (de63822) 74.17% compared to head (57701f5) 74.17%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #72   +/-   ##
=======================================
  Coverage   74.17%   74.17%           
=======================================
  Files           6        6           
  Lines         151      151           
  Branches       27       27           
=======================================
  Hits          112      112           
  Misses         32       32           
  Partials        7        7           

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

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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between de63822 and 57701f5.
Files ignored due to filter (4)
  • tests/frameworks/vite/snapshots/external.spec.ts.snap
  • package.json
  • pnpm-lock.yaml
  • tsconfig.json
Files selected for processing (7)
  • tests/fixtures/components/external.setup.vue (1 hunks)
  • tests/fixtures/noLocale.vue (1 hunks)
  • tests/fixtures/test.vue (1 hunks)
  • tests/frameworks/vite/errors.spec.ts (1 hunks)
  • tests/frameworks/webpack/sfc.spec.ts (1 hunks)
  • eslint.config.js (1 hunks)
  • src/loader-query.ts (1 hunks)
Files skipped from review due to trivial changes (4)
  • tests/fixtures/noLocale.vue
  • tests/fixtures/test.vue
  • tests/frameworks/vite/errors.spec.ts
  • eslint.config.js
Additional comments: 3
__tests__/fixtures/components/external.setup.vue (1)
  • 1-3: The change from test to userName seems to align with the updated string templates that use userName. Ensure that this variable change is reflected everywhere test was used.
src/loader-query.ts (1)
  • 38-39: The added conditions in the isCustomBlock function seem to correctly implement the intended logic for handling custom blocks with webpack. Verify that the options.blockType is always provided when this function is called to avoid potential issues.
__tests__/frameworks/webpack/sfc.spec.ts (1)
  • 47-48: The syntax correction in the expect statement now properly closes the toContainEqual matcher. This change should prevent any syntax errors during test execution.

@Demivan Demivan merged commit 1f64f9a into main Dec 27, 2023
@Demivan Demivan deleted the eslint branch December 27, 2023 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy