codemods for in-IDE refactoring of functions
These aren't really intended to be used with the jscodeshift
CLI, but rather for building IDE extensions.
Converts an arrow function with an expression body to a block statement.
const foo = () => 'foo!'
const foo = () => {
return 'foo!'
}
The start of the selection in the source code. This is used for determining which function to convert.
The end of the selection in the source code. This is used for determining which function to convert.
Converts the block statement body of an arrow function to an expression, as long as the body only consists of a return statement.
const foo = () => {
return 'foo!'
}
const foo = () => 'foo!'
The start of the selection in the source code. This is used for determining which function to convert.
The end of the selection in the source code. This is used for determining which function to convert.