danielroe / nuxt-capo

`capo.js` implementation for Nuxt 3
MIT License
82 stars 0 forks source link

chore: migrate to eslint v9 #128

Closed danielroe closed 4 months ago

danielroe commented 4 months ago

Summary by CodeRabbit

coderabbitai[bot] commented 4 months ago

Walkthrough

This update primarily focuses on refining the project's ESLint configurations and removing Prettier dependencies, alongside minor adjustments in code formatting and import order in various files. The ESLint version has been upgraded and the linting process has been streamlined to enhance code quality checks.

Changes

File(s) Change Summary
build.config.ts Added missing comma in externals array.
eslint.config.js Configured ESLint for a Nuxt project.
lint-staged.config.cjs Modified to run ESLint on specific file types, removed Prettier except for JSON.
package.json Removed Prettier scripts and dependencies, updated ESLint version and scripts.
playground/app.vue Updated SEO metadata description.
src/.../capo.client.ts,
src/.../capo.ts
Reordered imports, updated condition check.
src/.../logger.ts Improved function syntax and formatting.
test/e2e.spec.ts Updated a regex and a function definition.

Possibly related issues

🐇✨ A hop and a skip, the code does clean, With ESLint in place, the errors unseen. Commas and scripts, all neatly arrayed, In the land of code, where improvements are made. Celebrate we shall, with a carrot or two, For clean code triumphs, thanks to the crew! 🥕🎉


Recent Review Details **Configuration used: CodeRabbit UI**
Commits Files that changed from the base of the PR and between 266fbed41beb59533b60288c60dece1f39cd8dcc and 897d13c388066e2f83b77b2ae0e4cb18f783d170.
Files ignored due to path filters (1) * `pnpm-lock.yaml` is excluded by `!pnpm-lock.yaml`
Files selected for processing (9) * build.config.ts (1 hunks) * eslint.config.js (1 hunks) * lint-staged.config.cjs (1 hunks) * package.json (2 hunks) * playground/app.vue (1 hunks) * src/runtime/plugins/capo.client.ts (1 hunks) * src/runtime/server/plugins/capo.ts (1 hunks) * src/runtime/utils/logger.ts (3 hunks) * test/e2e.spec.ts (1 hunks)
Files skipped from review due to trivial changes (2) * build.config.ts * src/runtime/plugins/capo.client.ts
Additional comments not posted (7)
lint-staged.config.cjs (1)
`2-2`: Configuration correctly updated to use ESLint for linting JavaScript, TypeScript, and JSON files, aligning with the PR's objectives.
playground/app.vue (1)
`10-10`: The description in the SEO metadata appears unchanged. Please clarify if this was intended or if there's an error in the change documentation.
eslint.config.js (1)
`1-14`: ESLint configuration correctly set up for a Nuxt project using `@nuxt/eslint-config`, aligning with the PR's objectives to enhance linting.
src/runtime/server/plugins/capo.ts (1)
`6-6`: Condition check correctly updated to use `import.meta.dev`, aligning with modern JavaScript practices and the PR's objectives.
package.json (1)
`52-75`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [36-72] Scripts and dependencies in `package.json` correctly updated to focus on ESLint and remove Prettier, aligning with the PR's objectives.
test/e2e.spec.ts (1)
`16-16`: Regular expression correctly updated to remove ANSI escape codes, likely improving log readability in tests.
src/runtime/utils/logger.ts (1)
`145-174`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [123-190] Syntax and formatting improvements in the logger function enhance readability and maintainability, aligning with the PR's objectives for code consistency.
--- 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 - [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)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
socket-security[bot] commented 4 months ago

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/eslint@9.0.0 environment, filesystem Transitive: eval, shell, unsafe +88 10.5 MB eslintbot
npm/vue@3.3.11 environment, eval Transitive: filesystem, unsafe +23 14.4 MB yyx990803

🚮 Removed packages: npm/@nuxtjs/eslint-config-typescript@12.0.0, npm/eslint-config-prettier@9.1.0, npm/eslint-plugin-prettier@5.1.3, npm/eslint@8.57.0, npm/prettier@3.2.5

View full report↗︎

socket-security[bot] commented 4 months ago

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Potential typo squat npm/eslint-plugin-import-x@0.5.0
  • orphan: npm/eslint-plugin-import-x@0.5.0

View full report↗︎

Next steps

What is a typosquat?

Package name is similar to other popular packages and may not be the package you want.

Use care when consuming similarly named packages and ensure that you did not intend to consume a different package. Malicious packages often publish using similar names as existing popular packages.

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

  • @SocketSecurity ignore npm/eslint-plugin-import-x@0.5.0