Skip to content

ci: Fix eslint config #9723

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

Open
wants to merge 3 commits into
base: alpha
Choose a base branch
from
Open

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Apr 17, 2025

Pull Request

Issue

Eslint is broken, runs prettier

Summary by CodeRabbit

  • Style

    • Improved code formatting and readability throughout the project, including multi-line conditionals, consistent indentation, and clearer function structures.
    • Refactored test cases and internal code for uniform style without changing behavior.
    • Removed unnecessary ESLint directive comments and updated linting configuration for better code quality enforcement.
  • Chores

    • Updated linting scripts and configuration, including disabling certain lint rules and removing deprecated or redundant settings.
    • Deleted an obsolete ESLint configuration file for tests.
  • Bug Fixes

    • Added missing semicolons and corrected minor syntax issues in several files.
  • Tests

    • Added new test cases for unique index enforcement and master key access in push status queries.
    • Reformatted and clarified numerous test cases for enhanced maintainability and consistency.

No changes to user-facing features or functionality.

Copy link

🚀 Thanks for opening this pull request!

Copy link

codecov bot commented Apr 17, 2025

Codecov Report

Attention: Patch coverage is 90.90909% with 9 lines in your changes missing coverage. Please review.

Project coverage is 92.98%. Comparing base (e556812) to head (2cd4b32).

Files with missing lines Patch % Lines
src/SchemaMigrations/DefinedSchemas.js 55.55% 4 Missing ⚠️
src/Auth.js 75.00% 1 Missing ⚠️
src/Config.js 83.33% 1 Missing ⚠️
src/Controllers/SchemaController.js 90.00% 1 Missing ⚠️
src/Routers/GraphQLRouter.js 0.00% 1 Missing ⚠️
src/middlewares.js 91.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #9723      +/-   ##
==========================================
- Coverage   93.01%   92.98%   -0.04%     
==========================================
  Files         187      187              
  Lines       15081    15112      +31     
  Branches      174      174              
==========================================
+ Hits        14028    14052      +24     
- Misses       1041     1048       +7     
  Partials       12       12              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dplewis dplewis requested a review from a team April 17, 2025 16:49
Comment on lines +334 to +336
it_id('23caddd7-bfea-4869-8bd4-0f2cd283c8bd')(it)(
'can start Parse Server with auth via CLI',
done => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What line length is this enforcing? Looks less readable to me this way.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like prettier has a 100 line length

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set this to longer lines, like 170?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could but it’s up to you to review 170+ files being changed. My plan was to remove prettier and husky anyway like the JS SDK. Should I just redo this PR without running prettier?

Copy link
Member

@mtrezza mtrezza Apr 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I just redo this PR without running prettier?

I think that would be good; we may consider running a reformat across all files in a dedicated PR, if it's worth it. It's just such a large change that I'm afraid it would create merge conflicts or complicated rebases across pending PRs. Maybe we can do this if we get to a point where we clean up the PR list.

Copy link

coderabbitai bot commented Apr 30, 2025

📝 Walkthrough

Walkthrough

This update is primarily a large-scale codebase cleanup focused on stylistic and formatting consistency. The changes include expanding single-line conditional statements into multi-line blocks with braces, reformatting function signatures, improving indentation, and restructuring object literals and function calls for better readability. ESLint directive comments disabling console usage are removed throughout, and the ESLint configuration is updated to disable the no-console rule and expand the set of global variables. Several test files are reformatted for uniformity, and a few new or enhanced test cases are introduced, notably for unique index enforcement. No functional, logical, or exported entity changes are made, except for the removal of a test ESLint config file and the addition of one test case.

Changes

File(s) Change Summary
.releaserc.js, ci/CiVersionCheck.js, ci/definitionsCheck.js, ci/nodeEngineCheck.js, src/Adapters/Storage/Postgres/PostgresStorageAdapter.js, src/GraphQL/helpers/objectsQueries.js, src/cli/parse-server.js, src/cli/utils/commander.js, src/cli/utils/runner.js, src/cloud-code/Parse.Cloud.js Removed ESLint directive comments disabling no-console. No logic changes.
eslint.config.js Moved parserOptions under languageOptions, expanded globals with many test-related and environment-specific variables, and disabled the no-console rule.
package.json Removed the --flag unstable_config_lookup_from_file from lint scripts.
spec/eslint.config.js Deleted test ESLint configuration file.
src/vendor/mongodbUrl.js, src/middlewares.js, src/SchemaMigrations/DefinedSchemas.js, src/Controllers/SchemaController.js, src/Controllers/DatabaseController.js, src/RestWrite.js, src/RestQuery.js, src/Controllers/UserController.js, src/Controllers/FilesController.js, src/Config.js, src/StatusHandler.js, src/Utils.js, src/TestUtils.js, src/GraphQL/parseGraphQLUtils.js, src/Auth.js, src/Routers/GraphQLRouter.js, src/Routers/GlobalConfigRouter.js, src/Routers/PublicAPIRouter.js, src/Routers/UsersRouter.js, src/triggers.js Reformatted single-line conditionals and function signatures to multi-line blocks with braces and improved readability. No logic changes.
src/SchemaMigrations/DefinedSchemas.js Minor fix to spread operator usage in handleCLP.
spec/, spec/support/CurrentSpecReporter.js, spec/helper.js, spec/support/MockLdapServer.js Extensive reformatting and indentation improvements across almost all test files and helpers for consistency and readability. No logic changes.
spec/schemas.spec.js Added new test case for unique index enforcement on update.
spec/ParsePush.spec.js Added test case to verify querying _PushStatus with master key is allowed.
All other files Minor formatting, whitespace, or code style adjustments; no logic or exported entity changes.

Sequence Diagram(s)

sequenceDiagram
    participant Developer
    participant Linter
    participant TestSuite

    Developer->>Linter: Run ESLint (with updated config)
    Linter-->>Developer: No warnings for console statements

    Developer->>TestSuite: Run tests (with reformatted code)
    TestSuite-->>Developer: Test results (logic unchanged)

    Developer->>TestSuite: Run new/updated test for unique index
    TestSuite-->>Developer: Verifies unique index enforcement
Loading
sequenceDiagram
    participant User
    participant ParseServer
    participant Database

    User->>ParseServer: Save object with unique field
    ParseServer->>Database: Attempt to save/update
    Database-->>ParseServer: Enforces unique index
    ParseServer-->>User: Error if duplicate, success otherwise
Loading

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ast-grep (0.31.1)
spec/AuthenticationAdaptersV2.spec.js
spec/ParseQuery.spec.js
spec/ParseUser.spec.js
  • 6 others

🪧 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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 generate sequence diagram to generate a sequence diagram of the changes in this 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 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.

@parseplatformorg
Copy link
Contributor

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

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.

3 participants