Skip to main content
Frameworks

React .gitignore

.gitignore for frameworks projects

View on GitHub

.gitignore Content

# ============================================================================
# Created by https://gitignores.com/
# COMPREHENSIVE FRAMEWORK TEMPLATE for React
# Website: https://reactjs.org/
# Repository: https://github.com/facebook/react
# ============================================================================

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE OVERVIEW & USAGE NOTES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# • TEMPLATE TYPE: COMPREHENSIVE FRAMEWORK TEMPLATE
# • PURPOSE: Complete React framework patterns for build outputs, dependency cache, and development artifacts
# • DESIGN PHILOSOPHY: Self-contained with security, build, and development patterns
# • COMBINATION GUIDANCE: Use standalone; optionally add IDE/OS templates
# • SECURITY CONSIDERATIONS: Includes comprehensive security patterns for production
# • BEST PRACTICES: Use as standalone template, review security patterns, test with your setup
# • OFFICIAL SOURCES: React documentation and community best practices

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# SECURITY & SENSITIVE DATA PROTECTION (ALWAYS FIRST!)
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# CRITICAL: Protect sensitive data from accidental commits to version control

*.crt
*.key
*.keystore
*.pem
*.secret
*.token
*_keys
*_secrets
*_tokens
.env
.env.*
.env.*.local
.env.demo
.env.demo.local
.env.development
.env.development.local
.env.local
.env.production
.env.production.local
.env.qa
.env.qa.local
.env.staging
.env.staging.local
.env.test
.env.test.local
id_dsa
id_rsa

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# BUILD ARTIFACTS & DISTRIBUTION PACKAGES
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

*.dll
*.egg
*.egg-info/
*.exe
*.lib
*.so
*.tar.gz
*.whl
*.zip

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEPENDENCY MANAGEMENT & PACKAGE CACHE
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

*.tsbuildinfo
.cache/
.yarn/build-state.yml
build/
build/Release/
dist/
node_modules/

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# DEVELOPMENT & RUNTIME ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

*.log
*.log.*
.npm-debug.log*
.parcel-cache/
.pnpm-debug.log*
.rpt2_cache/
.tscache/
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# REACT-SPECIFIC PATTERNS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# React-specific build artifacts and development files

*.cjs.map
*.d.ts
*.js
*.js.map
*.mjs.map
.circleci/
.docusaurus
.eslintcache
.fleet/
.fusebox/
.github/
.gitlab/
.grunt
.jenkins/
.jest/
.lock-wscript
.next/
.node_repl_history
.nova/
.npm
.nuxt/
.parcel-cache
.pnp.*
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/
.serverless/
.storybook-out/
.stylelintcache
.tern-port
.ts-jest/
.ts-node/
.vscode-test/
.web_modules/
.yarn-integrity
.yarn/cache
.yarn/install-state.gz
.yarn/unplugged
.yarn/versions/
/.changelog
bower_components/
cover/
jspm_packages/
lib-cov/
lib/
my-app*
out/
pids/
public/
spec-reports
storybook-static/
template/src/__tests__/__snapshots__/
test-output/
test-reports
test-reports/
testng-results.xml
typings/
web_modules/

# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
# TESTING & QUALITY ASSURANCE ARTIFACTS
# ••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••

.coverage
.coverage.*
.coverage.xml
.coverage_html/
.nyc_output/
coverage-reports
coverage/
htmlcov/
junit.xml
test-results/

# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# TEMPLATE CUSTOMIZATION & BEST PRACTICES
# ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
# 1. REVIEW: Examine all patterns before use
# 2. CUSTOMIZE: Adapt to your project's specific structure
# 3. TEST: Use `git check-ignore` to verify patterns work correctly
# 4. SECURE: Always protect sensitive data and credentials
# 5. UPDATE: Review periodically as technology evolves

# RECOMMENDED USAGE PATTERNS:
# ============================

# BASIC USAGE (STANDALONE):
# -------------------------
# cp frameworks/react.gitignore .gitignore

# WITH IDE SUPPORT (TEAM DEVELOPMENT):
# ------------------------------------
# cat frameworks/react.gitignore \
#     ides/visual-studio-code.gitignore \
#     ides/intellij.gitignore > .gitignore

# CROSS-PLATFORM DEVELOPMENT:
# ---------------------------
# cat frameworks/react.gitignore \
#     os/linux.gitignore \
#     os/macos.gitignore \
#     os/windows.gitignore > .gitignore

# WITH DOCKER FOR DEPLOYMENT:
# ---------------------------
# cat frameworks/react.gitignore \
#     tools/docker.gitignore \
#     common/cache.gitignore > .gitignore

# ENTERPRISE SETUP WITH CI/CD:
# -----------------------------
# cat frameworks/react.gitignore \
#     tools/docker.gitignore \
#     tools/github-actions.gitignore \
#     common/cache.gitignore \
#     common/logs.gitignore > .gitignore

# IMPORTANT NOTES:
# ================
# 1. This template is self-contained and includes security patterns
# 2. No need to add common/security.gitignore separately
# 3. Test with `git status --ignored` to ensure proper coverage
# 4. Remove any patterns that conflict with your project structure
# 5. Consider your team's development tools when adding IDE templates

Note: This file is fetched from GitHub and cached for 7 days.