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

fix: adjust eslint configuration to eslint-plugin-svelte (previously used eslint-plugin-svelte3) #1310

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

kamilchlebek
Copy link
Contributor

@kamilchlebek kamilchlebek commented Apr 16, 2024

πŸ“‘ Description

I wanted to contribute to this repository, but once I opened .svelte file I noticed an eslint error:
image

The issue was introduced with this commit deec07e which changed eslint plugin from eslint-plugin-svelte3 to eslint-plugin-svelte. At that time .eslintrc.cjs wasn't updated accordingly.

side note: using .eslintrc.js is deprecated (see https://eslint.org/docs/latest/use/configure/configuration-files)

About linting files in general:

  • lint script never executes eslint as prettier fails with 163 files not matching standards (99.9% of them are not formatted json files)
  • once eslint is executed, it raises 102 problems

At the time all of the issues (pretter, eslint) are solved I'd suggest adding https://github.com/lint-staged/lint-staged (along with husky precommit hook) that will format & lint staged files (it will make sure all files committed to this repository follow the same rules)

I've also added .idea/ to .gitignore which stores local project configuration while using WebStorm IDE

Status

  • Not Completed
  • Completed

βœ… Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • I have checked the page with https://validator.unl.edu/
  • All the tests have passed
  • My pull request is based on the latest commit (not the npm version).

Summary by CodeRabbit

  • Refactor

    • Improved code quality by updating ESLint configurations for better Svelte file support.
  • Chores

    • Updated .gitignore to exclude the .idea/ directory, enhancing project cleanliness.

.idea/ contains project settings for WebStorm IDE
Copy link

vercel bot commented Apr 16, 2024

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
flowbite-svelte βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Apr 16, 2024 4:50pm
flowbite-svelte-update βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback Apr 16, 2024 4:50pm

Copy link

coderabbitai bot commented Apr 16, 2024

Walkthrough

This update enhances the configuration for handling Svelte files in the project by specifying a new parser and extending ESLint recommendations. Additionally, it improves the .gitignore file by excluding the .idea/ directory, ensuring that IDE-specific settings do not clutter the project repository.

Changes

File Change Summary
.eslintrc.cjs Updated to use svelte-eslint-parser, configured TypeScript parser options for Svelte, and added plugin:svelte/recommended. Removed previous Svelte-related settings.
.gitignore Added exclusion for .idea/ directory.

πŸ‡βœ¨
In fields of code, where lint rules play,
A tiny rabbit tweaks away.
No more .idea in the git,
Svelte files shine, perfectly fit.
Hop, hop, hooray for clean, clear days! 🌟🌿
πŸ‡βœ¨


Recent Review Details

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 27064a3 and 7b24e53.
Files selected for processing (2)
  • .eslintrc.cjs (1 hunks)
  • .gitignore (1 hunks)
Files skipped from review due to trivial changes (1)
  • .gitignore
Additional comments not posted (3)
.eslintrc.cjs (3)

4-4: The inclusion of plugin:svelte/recommended in the extends array aligns well with the project's use of Svelte, ensuring adherence to recommended linting practices.


10-10: Setting svelte-eslint-parser as the parser for Svelte files is a necessary update to handle Svelte-specific syntax correctly.


12-12: Specifying @typescript-eslint/parser within parserOptions for Svelte files ensures that TypeScript code embedded in Svelte files is correctly parsed.


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.

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 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.
  • 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.

@shinokada
Copy link
Collaborator

@pasevin Will this work for Svelte 3?

@pasevin
Copy link

pasevin commented Apr 17, 2024

@pasevin Will this work for Svelte 3?

This shouldn't cause any issues for Svelte 3.

@shinokada shinokada merged commit 0d9a933 into themesberg:main Apr 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants