Provides configuration point for replacing modules/provides that are assumed to be available; e.g. os.settings.get(...). Supports non-matching requires (e.g. require('os.config.Settings'); and/or singletons using getInstance().
To get more configs into the implicit require replacements list, create a file ../my-project-directory/.jscodeshift.json with the format:
{"globals": { "my.global.namespace": {"require": "my.alternate.namespace", "singleton": false}}} where "require" defaults to match the key when undefined and "singleton" defaults to false when undefined.
Potential future improvements include:
Checking the number of .getInstance() calls for one replacement in a function and creating a local const when more than 2
Checking the number of .getInstance() calls for one replacement in a file, and creating a file const when more than 10
Provides configuration point for replacing modules/provides that are assumed to be available; e.g.
os.settings
.get(...). Supports non-matching requires (e.g. require('os.config.Settings'); and/or singletons using getInstance().To get more configs into the implicit require replacements list, create a file ../my-project-directory/.jscodeshift.json with the format:
{"globals": { "my.global.namespace": {"require": "my.alternate.namespace", "singleton": false}}}
where "require" defaults to match the key when undefined and "singleton" defaults to false when undefined.Potential future improvements include: