GitShow/facebook/jscodeshift
facebook

jscodeshift

A JavaScript codemod toolkit.

by facebook
Star on GitHubForkWebsitenpm

JavaScript

10.0k stars493 forks131 contributorsActive · 4d agoSince 2015MIT

Meet the team

See all 131 on GitHub →
fkling
fkling195 contributions
dependabot[bot]Bot
dependabot[bot]41 contributions
cpojer
cpojer32 contributions
Daniel15
Daniel1527 contributions
ElonVolo
ElonVolo21 contributions
trivikr
trivikr18 contributions
gkz
gkz14 contributions
jbrown215
jbrown2157 contributions

Recent PRs & issues

Active · Last activity 4d ago
See all on GitHub →
cimak
Can I inert inline `commentBlock` before an argument?OpenIssue

I have: and I want to insert inline block comment, like this: Unfortunately, Im always getting newline between comment and argument: Any Ideas? Playground: https://astexplorer.net/#/gist/efea82bb2a028629e17f70a97e43a355/9d951cc12f51086f315d6772443c603dfb020aa4 Transformer:

cimak · 5d ago
dashitongzhi
feat: add cookbook section with practical recipes for common jscodeshift tasksOpenPR

This addresses issue #193 by adding a comprehensive cookbook section with practical, copy-pasteable examples for new users. Changes Added a new 'Cookbook: Practical Recipes for Common Tasks' section to README.md containing 7 complete recipes: 1. Changing literal values in object properties - The exact use case from issue #193 (changing to ) 2. Adding new properties to objects - Using to create new object properties 3. Renaming identifiers throughout a file - Using and for simple replacements 4. Converting CommonJS to ES modules - Replacing and 5. Wrapping function calls with higher-order functions - Adding logging/error handling patterns 6. Converting Array.indexOf() !== -1 to Array.includes() - Modern JS pattern upgrade 7. Transforming for loops to forEach - Converting classic for loop patterns Each recipe includes before/after code examples and complete transform code that can be copied directly into a transform.js file. Motivation Issue #193 described that new users find the documentation "very thin on examples" and lack simple examples for tasks like "changing the literal value of something." This cookbook directly addresses that gap by providing working, minimal examples for common codemod patterns.

dashitongzhi · 1mo ago
dashitongzhi
Fix multiple code quality issuesOpenPR

Summary This PR fixes multiple code quality issues found during code review: Bug Fixes 1. *: Fixed a bug where (which is for objects) was used instead of . This caused to be , breaking the intersection logic. Also added validation for empty/null arrays input. 2. : Added try/catch around to gracefully handle missing or inaccessible ignore config files, with a warning message instead of crashing. 3. : Added try/catch around for the option to provide a helpful error message instead of crashing with a confusing JSON syntax error. 4. : Replaced in an async callback with proper error handling that calls and logs a warning. Throwing in an async callback causes uncaught errors that crash the process. Improvements 5. : Added early return for empty nodes array in . Added clarifying comments explaining the reduce() index calculation. 6. *: Added helper function to safely access default exports from Babel presets/plugins that may use either or export pattern. All changes are backward compatible and do not change the public API.

dashitongzhi · 1mo ago

Recent fixes

View closed PRs →
codingjoe
Add iterator implementation to CollectionsMergedPR

ES6 iterators support the new for..of syntax. Since a wraps an , we can lean on ECMAScript's new iterator delegation. Resolve #679 I am working on esupgrade a tool to upgrade JS/TS code to widely available ECMAScript features. It's built on this wonderful tool. I'd really love to keep esupgrade's code base up to date too, and using for..of loops and generators would help tremendously. Thanks for your consideration and for publishing this under a free license <3

codingjoe · 1mo ago
Structured data for AI agents

Repository: facebook/jscodeshift. Description: A JavaScript codemod toolkit. Stars: 10018, Forks: 493. Primary language: JavaScript. License: MIT. Homepage: https://jscodeshift.com Open PRs: 28, open issues: 125. Last activity: 4d ago. Top contributors: fkling, dependabot[bot], cpojer, Daniel15, ElonVolo, trivikr, gkz, jbrown215, marcodejongh, sharils and others.

·@ofershap

Replace github.com with gitshow.dev