Skip to content

[Feature]: Add # Playwright comment to .gitignore entries added by playwright #33307

@hamirmahal

Description

@hamirmahal

🚀 Feature Request

Current behavior

npm init playwright@latest results in

$  cat .gitignore 
# Previous .gitignore entries...
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

Desired behavior

I think it'd be nice if npm init playwright@latest resulted in

$  cat .gitignore 
# Previous .gitignore entries...

# Playwright
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/

instead.

Example

No response

Motivation

It helps readability when .gitignore entries are separated into appropriate sections.

For example, see .gitignore after doing npx create-next-app@latest

$  cat my-app/.gitignore 
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/versions

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# env files (can opt-in for commiting if needed)
.env*

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions