0.2.2 • Published 5 years ago

@nullvoxpopuli/optional-chaining-codemod v0.2.2

Weekly downloads
5
License
MIT
Repository
-
Last release
5 years ago

optional-chaining-codemod

Transforms:

foo && foo.bar;
foo.bar && foo.bar.baz;

(foo || {}).bar;
((foo || {}).bar || {}).baz;
((foo || {}).bar || {}).baz();

to

foo?.bar;
foo.bar?.baz;

foo?.bar;
foo?.bar?.baz;
foo?.bar?.baz();

Usage

To run a specific codemod from this project, you would run the following:

npx @nullvoxpopuli/optional-chaining-codemod path/of/files/ or/some**/*glob.js

# or

yarn global add @nullvoxpopuli/optional-chaining-codemod
optional-chaining-codemod path/of/files/ or/some**/*glob.js

# or

volta install @nullvoxpopuli/optional-chaining-codemod
optional-chaining-codemod path/of/files/ or/some**/*glob.js

Transforms

Contributing

Installation

  • clone the repo
  • change into the repo directory
  • yarn

Running tests

  • yarn test

Update Documentation

  • yarn update-docs
0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago