Skip to content

entria/toNamedParametersCodemod

Repository files navigation

ToNamedParameter Codemod

transform

export const defineTest = (
  dirName,
  transformName,
  options,
  testFilePrefix,
  only = false,
) => {
  console.log('ok')
}

to

export const defineTest = ({
  dirName,
  transformName,
  options,
  testFilePrefix,
  only = false,
}) => {
  console.log('ok')
}

Config

module.exports = {
  // function call name
  callee: 'defineTest',
  // list of all parameters
  parameters: [
    'dirName',
    'transformName',
    'options',
    'testFilePrefix',
    'only',
  ],
}

Usage

find packages/codemod/src -iname '*.spec.ts' -print | xargs jscodeshift -t packages/codemod/src/toNamedParameters/ToNamedParameters.ts --config toNamed.codemod.config.js

Releases

No releases published

Packages

No packages published