Skip to content

apply jscodeshift to active text editor in VSCode, passing selected range as options

License

Notifications You must be signed in to change notification settings

vscodeshift/apply-jscodeshift

Repository files navigation

@vscodeshift/apply-jscodeshift

CircleCI Coverage Status semantic-release Commitizen friendly npm version

apply jscodeshift to active text editor, passing selected range as options.

Tries to intelligently determine the parser. If @babel/core is present in the project, it will be used along with the project's babel config (except for ts/x files).

applyTransform(transform, [options])

import applyTransform from '@vscodeshift/apply-jscodeshift'

Applies the given jscodeshift transform to the active text editor.

Arguments

transform (jscodeshift.Transform, required)

The transform to apply.

options (jscodeshift.Options, optional)

Options to pass to the transform. By default, selectionStart and selectionEnd will be passed to the transform.

Returns (Promise<string | void | null | undefined>)

A promise that will resolve to the output of the transform (which will have also been applied to the active text editor if it returns a string)

About

apply jscodeshift to active text editor in VSCode, passing selected range as options

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published