Add command options for avoiding vscode error checking problems
I encountered a bunch of errors from vscode because the default configurations don't match to esm. (see: prisma/prisma#28279) This changes can:
- Set
typeoption inpackage.jsonfile tomodule. Ref: https://docs.npmjs.com/cli/v11/commands/npm-init#init-type - Set
compilerOptions.typesintsconfig.jsonto["node"]for acceptingnode:-prefixed modules. Ref: https://www.typescriptlang.org/docs/handbook/compiler-options.html
Summary by CodeRabbit
- Documentation
- Updated multiple getting-started guides to initialize new projects with ES module support by default (uses npm init --init-type=module -y).
- Clarified TypeScript setup to include Node.js type definitions when initializing the TS config (uses npx tsc --init --types node).
Walkthrough
Documentation updates across multiple getting-started guides to initialize Node.js projects with ES module support by changing npm init -y to npm init --init-type=module -y, and to include Node.js type definitions in TypeScript setup by changing npx tsc --init to npx tsc --init --types=node.
Changes
| Cohort / File(s) | Change Summary |
|---|---|
Quickstart (SQLite) content/100-getting-started/01-quickstart-sqlite.mdx |
Replaced npm init -y with npm init --init-type=module -y |
Relational DBs β Node (multiple DBs) content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-node-*.mdx |
Replaced npm init -y with npm init --init-type=module -y across Node guides (Postgres, MySQL, SQL Server, CockroachDB, PlanetScale) |
Relational DBs β TypeScript (multiple DBs) content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-*.mdx |
Replaced npm init -y with npm init --init-type=module -y and changed npx tsc --init to npx tsc --init --types=node across TypeScript guides |
MongoDB β Node content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-node-mongodb.mdx, content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/125-introspection-node-mongodb.mdx |
Replaced npm init -y with npm init --init-type=module -y |
MongoDB β TypeScript content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx, content/100-getting-started/02-setup-prisma/200-add-to-existing-project/120-mongodb/125-introspection-typescript-mongodb.mdx |
Replaced npm init -y with npm init --init-type=module -y and npx tsc --init with npx tsc --init --types=node |
Postgres CLI Guide content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx |
Replaced npm init -y with npm init --init-type=module -y and npx tsc --init with npx tsc --init --types=node |
Estimated code review effort
π― 2 (Simple) | β±οΈ ~12 minutes
Pre-merge checks
β Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | β Passed | Check skipped - CodeRabbitβs high-level summary is enabled. |
| Title Check | β Passed | The PR title "Add command options for avoiding vscode error checking problems" directly describes the main change in the pull request. The changeset updates multiple documentation files to add command-line options (--init-type=module for npm and --types node for TypeScript) that configure ES module support and Node.js type definitions to resolve VS Code error checking issues. The title accurately captures both the action (adding command options) and the purpose (avoiding VS Code errors), making it clear and relevant to a reviewer scanning the history. |
| Docstring Coverage | β Passed | No functions found in the changes. Docstring coverage check skipped. |
π Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
π₯ Commits
Reviewing files that changed from the base of the PR and between 32d20502c99a97a57e27a118551ae3d107bdaf97 and 101f6152a2d1bf940423a6f5ceba928ae8520899.
β Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
π Files selected for processing (9)
content/100-getting-started/01-quickstart-sqlite.mdx(2 hunks)content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-cockroachdb.mdx(2 hunks)content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-mysql.mdx(2 hunks)content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-planetscale.mdx(2 hunks)content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-postgresql.mdx(2 hunks)content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-prismaPostgres.mdx(2 hunks)content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-sqlserver.mdx(2 hunks)content/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx(2 hunks)content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx(2 hunks)
π§ Files skipped from review as they are similar to previous changes (5)
- content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-mysql.mdx
- content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-planetscale.mdx
- content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-postgresql.mdx
- content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-cockroachdb.mdx
- content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-prismaPostgres.mdx
π§° Additional context used
π§ Learnings (4)
π Common learnings
Learnt from: jy-joung-bitor
PR: prisma/docs#0
File: :0-0
Timestamp: 2025-10-15T06:36:42.423Z
Learning: The `npm init` command supports the `--init-type=module` flag to initialize a project with ES module type in package.json. This is a valid npm CLI option documented at https://docs.npmjs.com/cli/v11/commands/npm-init#init-type
Learnt from: jy-joung-bitor
PR: prisma/docs#0
File: :0-0
Timestamp: 2025-10-15T06:36:42.423Z
Learning: The `tsc --init` command requires the `--types node` flag to properly include Node.js type definitions from `types/node` in the generated tsconfig.json, even when types/node is already installed. Without this flag, TypeScript may not automatically pick up Node.js typings.
π Learning: 2025-10-15T06:36:42.423Z
Learnt from: jy-joung-bitor
PR: prisma/docs#0
File: :0-0
Timestamp: 2025-10-15T06:36:42.423Z
Learning: The `tsc --init` command requires the `--types node` flag to properly include Node.js type definitions from `types/node` in the generated tsconfig.json, even when types/node is already installed. Without this flag, TypeScript may not automatically pick up Node.js typings.
Applied to files:
content/100-getting-started/01-quickstart-sqlite.mdxcontent/100-getting-started/03-prisma-postgres/100-from-the-cli.mdxcontent/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-sqlserver.mdxcontent/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx
π Learning: 2025-10-15T06:36:42.423Z
Learnt from: jy-joung-bitor
PR: prisma/docs#0
File: :0-0
Timestamp: 2025-10-15T06:36:42.423Z
Learning: The `npm init` command supports the `--init-type=module` flag to initialize a project with ES module type in package.json. This is a valid npm CLI option documented at https://docs.npmjs.com/cli/v11/commands/npm-init#init-type
Applied to files:
content/100-getting-started/01-quickstart-sqlite.mdxcontent/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx
π Learning: 2025-10-09T21:32:50.340Z
Learnt from: aidankmcalister
PR: prisma/docs#7167
File: content/900-ai/prompts/astro.mdx:84-84
Timestamp: 2025-10-09T21:32:50.340Z
Learning: The `npx prisma init` command supports the following flags: `--db` (shorthand for `--datasource-provider prisma+postgres`), `--output` (specifies output location for generated client), `--generator-provider` (defines the generator provider), `--datasource-provider`, `--url`, `--preview-feature`, and `--with-model`. These are documented valid CLI options for Prisma init command.
Applied to files:
content/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx
π Additional comments (8)
content/100-getting-started/02-setup-prisma/100-start-from-scratch/110-relational-databases-typescript-sqlserver.mdx (2)
45-48: Correct ES module initialization with npm flag.The
--init-type=moduleflag properly sets"type": "module"inpackage.json, enabling ES module support as intended. Based on learnings
54-56: Correct Node.js typings configuration with tsc flag.The
--types nodeflag correctly configures TypeScript to include Node.js type definitions intsconfig.json. Based on learningscontent/100-getting-started/02-setup-prisma/100-start-from-scratch/120-mongodb-typescript-mongodb.mdx (2)
44-47: Correct ES module initialization with npm flag.The
--init-type=moduleflag properly sets"type": "module"inpackage.jsonfor ES module support, consistent with other guides in this PR. Based on learnings
53-55: Correct Node.js typings configuration with tsc flag.The
--types nodeflag correctly configures TypeScript to include Node.js type definitions, consistent with other guides in this PR. Based on learningscontent/100-getting-started/01-quickstart-sqlite.mdx (2)
36-39: Correct ES module initialization with npm flag.The
--init-type=moduleflag properly configures ES module support inpackage.json. This is important for the Quickstart guide as it's a high-visibility entry point. Based on learnings
51-53: Correct Node.js typings configuration with tsc flag.The
--types nodeflag correctly includes Node.js type definitions intsconfig.json. Based on learningscontent/100-getting-started/03-prisma-postgres/100-from-the-cli.mdx (2)
103-106: Correct ES module initialization with npm flag.The
--init-type=moduleflag properly configures ES module support inpackage.json, consistent with other setup guides in this PR. Based on learnings
112-114: Correct Node.js typings configuration with tsc flag.The
--types nodeflag correctly includes Node.js type definitions intsconfig.json, consistent with other setup guides in this PR. Based on learnings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
Thanks for opening a PR! There are some conflicts with the recent updates for Prisma 7. Would you be able to resolve those?