parse-server
parse-server copied to clipboard
ci: Fix eslint config
Pull Request
- Report security issues confidentially.
- Any contribution is under this license.
- Link this pull request to an issue.
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.
🚀 Thanks for opening this pull request!
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).
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
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
📝 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
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
[!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
@coderabbitaiin 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
@coderabbitaiin 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 pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai resolveresolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit Configuration File (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile 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.
:tada: Snyk checks have passed. No issues have been found so far.
:white_check_mark: security/snyk check is complete. No issues have been found. (View Details)