Skip to content

chore: add .editorconfig for consistent code formatting#17227

Open
srpatcha wants to merge 5 commits intofacebook:mainfrom
srpatcha:chore/add-editorconfig
Open

chore: add .editorconfig for consistent code formatting#17227
srpatcha wants to merge 5 commits intofacebook:mainfrom
srpatcha:chore/add-editorconfig

Conversation

@srpatcha
Copy link
Copy Markdown

Changes

chore: add .editorconfig for consistent code formatting

Signed with GPG.

@meta-cla meta-cla Bot added the CLA Signed label Apr 25, 2026
srpatcha and others added 4 commits April 24, 2026 22:03
line.match(/ .*/g)[0] crashed with TypeError when the regex had no
match and returned null. Added null-safe handling with optional
chaining to prevent the crash during eject.

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
Signed-off-by: Srikanth Patchava <srikanth.patchava@outlook.com>
Add templateValidator.js with comprehensive CRA template validation:
- Template structure validation (required files check)
- Package.json schema validation with blocked keys
- Dependency conflict detection with react-scripts
- Script hook validation
- Path traversal prevention (dangerous patterns, symlinks)
- Template directory scanning for unsafe files
- Version compatibility checking
- Combined validation runner with detailed error messages

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
Add Jest test suite for templateValidator.js covering:
- Template structure validation (missing files, TS alternatives)
- Package.json schema validation (blocked keys, deprecated fields)
- Dependency conflict detection
- Script hook validation
- Path traversal prevention
- Version compatibility checking
- Integration test combining all validations

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
Add filter and dereference options to fs.copySync in init.js to prevent
malicious templates from writing files outside the target app directory.
The filter validates that each resolved destination path stays within
appPath, blocking path traversal via '../' patterns and symlinks.

Signed-off-by: Srikanth Patchava <spatchava@meta.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant