{"_id":"@brightlocaldev/ts-migrate-plugins","_rev":"2-9fd899ecf85129e1117124ba7d10ab27","name":"@brightlocaldev/ts-migrate-plugins","dist-tags":{"latest":"0.1.40"},"versions":{"0.1.36":{"name":"@brightlocaldev/ts-migrate-plugins","version":"0.1.36","keywords":["ts-migrate","ts-migrate-plugins","typescript","migration","codemod"],"license":"MIT","_id":"@brightlocaldev/ts-migrate-plugins@0.1.36","maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"contributors":[{"url":"https://github.com/brieb","name":"Brie Bunge"},{"url":"https://github.com/Rudeg","name":"Sergii Rudenko"},{"url":"https://github.com/elliotsa","name":"Elliot Sachs"},{"url":"https://github.com/jjjjhhhhhh","name":"John Haytko"},{"url":"https://github.com/lencioni","name":"Joe Lencioni"}],"homepage":"https://github.com/airbnb/ts-migrate#readme","bugs":{"url":"https://github.com/airbnb/ts-migrate/issues"},"dist":{"shasum":"9adc1fcb8d193369d1dd2ae92050ac6e4b5f9689","tarball":"https://registry.npmjs.org/@brightlocaldev/ts-migrate-plugins/-/ts-migrate-plugins-0.1.36.tgz","fileCount":87,"integrity":"sha512-KHoKMzT40NcmTj9LkXv3vjJ13zOobPEXlO5MKxr53vrcMxnzTXGmk4NPJ2iK/pmPj5n2d25u9SHvXpkwP8xdbQ==","signatures":[{"sig":"MEUCIQCYG3k8r2WMzeuNxTpRyW77t4GDqyUwhGZWlsWdBHwZIQIgTGDOZ0qaKdiZi/WWSOW88VRWhwX4kx97QB3qcWybu8Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":314724},"main":"build/src/index.js","gitHead":"d97941c3998da9b610fcc56b6f99756e279c7586","scripts":{"lint":"eslint . --ext=.js,.jsx,.ts,.tsx --ignore-path ../../.eslintignore","test":"jest --config jest-config.json","build":"tsc -p tsconfig.json","clean":"rm -rf build","prepublish":"yarn build"},"_npmUser":{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},"repository":{"url":"git+https://github.com/airbnb/ts-migrate.git","type":"git","directory":"packages/ts-migrate-plugins"},"_npmVersion":"lerna/3.22.1/node@v18.20.4+x64 (linux)","description":"Set of codemods, which are doing transformation of js/jsx to ts/tsx","directories":{"test":"tests"},"_nodeVersion":"18.20.4","dependencies":{"eslint":"^7.14.0","jscodeshift":"^0.13.0","json-schema":"^0.4.0","ts-migrate-server":"^0.1.33"},"_hasShrinkwrap":false,"devDependencies":{"jest":"26.6.3","@types/json-schema":"^7.0.7","@ts-morph/bootstrap":"^0.16.0"},"peerDependencies":{"typescript":">4.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-migrate-plugins_0.1.36_1737037422983_0.028311121825104202","host":"s3://npm-registry-packages-npm-production"}},"0.1.38":{"name":"@brightlocaldev/ts-migrate-plugins","version":"0.1.38","keywords":["ts-migrate","ts-migrate-plugins","typescript","migration","codemod"],"license":"MIT","_id":"@brightlocaldev/ts-migrate-plugins@0.1.38","maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"contributors":[{"url":"https://github.com/brieb","name":"Brie Bunge"},{"url":"https://github.com/Rudeg","name":"Sergii Rudenko"},{"url":"https://github.com/elliotsa","name":"Elliot Sachs"},{"url":"https://github.com/jjjjhhhhhh","name":"John Haytko"},{"url":"https://github.com/lencioni","name":"Joe Lencioni"}],"homepage":"https://github.com/airbnb/ts-migrate#readme","bugs":{"url":"https://github.com/airbnb/ts-migrate/issues"},"dist":{"shasum":"fb0b9994ae9ffaf9f11b4fdafd6eb7d5312e2a3f","tarball":"https://registry.npmjs.org/@brightlocaldev/ts-migrate-plugins/-/ts-migrate-plugins-0.1.38.tgz","fileCount":87,"integrity":"sha512-A0iueLVM2CISXo7ZdDSnmn6Dg2OC9X6wpIBangI9WPb/x00k0aGbNRDJFXGyp77XJHlVer/ifyfXYD3bQOBhZQ==","signatures":[{"sig":"MEYCIQC8IE03qRhAYC66i7VkT8nxbUI3UlfUP2qC7y2LgMi4qgIhAIuFPzLUODMmMqBIK7rZtFjbWNNPM7M2AjMbHmVs/rH2","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":316698},"main":"build/src/index.js","gitHead":"d5cc878764825ac643754e4eda023c83e2e86b78","scripts":{"lint":"eslint . --ext=.js,.jsx,.ts,.tsx --ignore-path ../../.eslintignore","test":"jest --config jest-config.json","build":"tsc -p tsconfig.json","clean":"rm -rf build","prepublish":"yarn build"},"_npmUser":{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},"repository":{"url":"git+https://github.com/airbnb/ts-migrate.git","type":"git","directory":"packages/ts-migrate-plugins"},"_npmVersion":"lerna/3.22.1/node@v18.20.4+x64 (linux)","description":"Set of codemods, which are doing transformation of js/jsx to ts/tsx","directories":{"test":"tests"},"_nodeVersion":"18.20.4","dependencies":{"eslint":"^7.14.0","typescript":"4.7.2","jscodeshift":"^0.13.0","json-schema":"^0.4.0","@brightlocaldev/ts-migrate-server":"^0.1.38"},"_hasShrinkwrap":false,"devDependencies":{"jest":"26.6.3","@types/json-schema":"^7.0.7","@ts-morph/bootstrap":"^0.16.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-migrate-plugins_0.1.38_1737037636050_0.04133287837259858","host":"s3://npm-registry-packages-npm-production"}},"0.1.40":{"name":"@brightlocaldev/ts-migrate-plugins","version":"0.1.40","description":"Set of codemods, which are doing transformation of js/jsx to ts/tsx","main":"build/src/index.js","directories":{"test":"tests"},"keywords":["ts-migrate","ts-migrate-plugins","typescript","migration","codemod"],"repository":{"type":"git","url":"git+https://github.com/brightlocal/ts-migrate.git","directory":"packages/ts-migrate-plugins"},"bugs":{"url":"https://github.com/brightlocal/ts-migrate/issues"},"scripts":{"test":"jest --config jest-config.json","lint":"eslint . --ext=.js,.jsx,.ts,.tsx --ignore-path ../../.eslintignore","build":"tsc -p tsconfig.json","prepublish":"yarn build","clean":"rm -rf build"},"contributors":[{"name":"Brie Bunge","url":"https://github.com/brieb"},{"name":"Sergii Rudenko","url":"https://github.com/Rudeg"},{"name":"Elliot Sachs","url":"https://github.com/elliotsa"},{"name":"John Haytko","url":"https://github.com/jjjjhhhhhh"},{"name":"Joe Lencioni","url":"https://github.com/lencioni"}],"homepage":"https://github.com/brightlocal/ts-migrate#readme","license":"MIT","dependencies":{"@brightlocaldev/ts-migrate-server":"^0.1.40","eslint":"^7.14.0","jscodeshift":"^0.13.0","json-schema":"^0.4.0","typescript":"4.7.2"},"gitHead":"744cd7a9668929fdf024e467081128124c244db9","devDependencies":{"@ts-morph/bootstrap":"^0.16.0","@types/json-schema":"^7.0.7","jest":"26.6.3"},"_id":"@brightlocaldev/ts-migrate-plugins@0.1.40","_nodeVersion":"18.20.4","_npmVersion":"lerna/3.22.1/node@v18.20.4+x64 (linux)","dist":{"integrity":"sha512-Zc+Zf0RzV5PLVhLuNee0D22Nmm0xO+5weWXBg9rRP9WmGMVYfWxnt/IGptdgCB6laf2W/QU5SlXVBwXeNCNH6A==","shasum":"d3385b166c6b58b9c2919b4178b78e811969d6cb","tarball":"https://registry.npmjs.org/@brightlocaldev/ts-migrate-plugins/-/ts-migrate-plugins-0.1.40.tgz","fileCount":87,"unpackedSize":316713,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0mfOG+yBtaBubp4fs8TZDSmCSLc7tOiSTVcbvmnZGwwIhAOorB2MjibBokBarXubfoXdSUPGEGwuCG4850hs40V3i"}]},"_npmUser":{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},"maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ts-migrate-plugins_0.1.40_1737462101262_0.057036037381172466"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-16T14:23:42.529Z","modified":"2025-01-21T12:21:41.738Z","0.1.36":"2025-01-16T14:23:43.194Z","0.1.38":"2025-01-16T14:27:16.266Z","0.1.40":"2025-01-21T12:21:41.486Z"},"bugs":{"url":"https://github.com/brightlocal/ts-migrate/issues"},"license":"MIT","homepage":"https://github.com/brightlocal/ts-migrate#readme","keywords":["ts-migrate","ts-migrate-plugins","typescript","migration","codemod"],"repository":{"type":"git","url":"git+https://github.com/brightlocal/ts-migrate.git","directory":"packages/ts-migrate-plugins"},"description":"Set of codemods, which are doing transformation of js/jsx to ts/tsx","contributors":[{"name":"Brie Bunge","url":"https://github.com/brieb"},{"name":"Sergii Rudenko","url":"https://github.com/Rudeg"},{"name":"Elliot Sachs","url":"https://github.com/elliotsa"},{"name":"John Haytko","url":"https://github.com/jjjjhhhhhh"},{"name":"Joe Lencioni","url":"https://github.com/lencioni"}],"maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"readme":"# ts-migrate-plugins\n\n_ts-migrate-plugins_ is designed as a set of plugins, so that it can be pretty customizable for different use-cases.\nThis package contains a set of [codemods](https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb) (plugins), which are doing transformation of js/jsx -> ts/tsx.\n\n_ts-migrate-plugins_ is designed around Airbnb projects. Use at your own risk.\n\n# Install\n\nInstall _ts-migrate_ using [npm](https://www.npmjs.com):\n\n`npm install --save-dev ts-migrate-plugins`\n\nOr [yarn](https://yarnpkg.com):\n\n`yarn add --dev ts-migrate-plugins`\n\n# Usage\n\n```typescript\nimport path from \"path\";\nimport { tsIgnorePlugin } from \"ts-migrate-plugins\";\nimport { migrate, MigrateConfig } from \"@brightlocaldev/ts-migrate-server\";\n\n// get input files folder\nconst inputDir = path.resolve(__dirname, \"input\");\n\n// create new migration config and add ts-ignore plugin with empty options\nconst config = new MigrateConfig().addPlugin(tsIgnorePlugin, {});\n\n// run migration\nconst exitCode = await migrate({ rootDir: inputDir, config });\n\nprocess.exit(exitCode);\n```\n\n# List of [plugins](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src)\n\n| Name                                                                                                                                                             | Description                                                                                                   |\n| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |\n| [add-conversions](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/add-conversions.ts)                                   | Add conversions to `any` (`$TSFixMe`) in the case of type errors.                                             |\n| [declare-missing-class-properties](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/declare-missing-class-properties.ts) | Declare missing class properties.                                                                             |\n| [eslint-fix](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/eslint-fix.ts)                                             | Run eslint fix to fix any eslint violations that happened along the way.                                      |\n| [explicit-any](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/explicit-any.ts)                                         | Annotate variables with `any` (`$TSFixMe`) in the case of an implicit any violation.                          |\n| [hoist-class-statics](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/hoist-class-statics.ts)                           | Hoist static class members into the class body (vs. assigning them after the class definition).               |\n| [jsdoc](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/jsdoc.ts)                                                       | Convert JSDoc @param types to TypeScript annotations.                                                         |\n| [member-accessibility](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/member-accessibility.ts)                         | Add accessibility modifiers (private, protected, or public) to class members according to naming conventions. |\n| [react-class-lifecycle-methods](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/react-class-lifecycle-methods.ts)       | Annotate React lifecycle method types.                                                                        |\n| [react-class-state](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/react-class-state.ts)                               | Declare React state type.                                                                                     |\n| [react-default-props](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/react-default-props.ts)                           | Annotate React default props.                                                                                 |\n| [react-props](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/react-props.ts)                                           | Convert React prop types to TypeScript type.                                                                  |\n| [react-shape](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/react-shape.ts)                                           | Convert prop types shapes to TypeScript type.                                                                 |\n| [strip-ts-ignore](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/strip-ts-ignore.ts)                                   | Strip `// @ts-ignore`. comments                                                                               |\n| [ts-ignore](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-plugins/src/plugins/ts-ignore.ts)                                               | Add `// @ts-ignore` comments for the remaining errors.                                                        |\n\n# Type of plugins\n\nWe have three main categories of plugins:\n\n- Text based plugins. Plugins of this category are operating with a text of source files and operate based on this. Example: [example-plugin-text](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-example/src/example-plugin-text.ts).\n\n- Jscodeshift based plugins. These plugins are using a [jscodeshift toolkit](https://github.com/facebook/jscodeshift) as a base for operations and transformations around Abstract Syntax Tree. Example: [example-plugin-jscodeshift](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-example/src/example-plugin-jscodeshift.ts).\n\n- TypeScript ast-based plugins. The main idea behind these plugins is by parsing Abstract Syntax Tree with [TypeScript compiler API](https://github.com/microsoft/TypeScript/wiki/Using-the-Compiler-API), we can generate an array of updates for the text and apply them to the source file. Example: [example-plugin-ts](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-example/src/example-plugin-ts.ts).\n\n# FAQ\n\n> What is the ts-migrate plugin?\n\nThe plugin is an abstraction around codemods which provides centralized interfaces for the _ts-migrate_. Plugins should implement the following interface:\n\n```typescript\ninterface Plugin {\n  name: string\n  run(params: PluginParams<TPluginOptions = {}>): Promise<string | void> | string | void\n}\n\ninterface PluginParams<TPluginOptions = {}> {\n  options: TPluginOptions;\n  fileName: string;\n  rootDir: string;\n  text: string;\n  sourceFile: ts.SourceFile;\n  getLanguageService: () => ts.LanguageService;\n}\n```\n\n> How I can write my own plugin?\n\nYou can take a look into the [plugin examples](https://github.com/airbnb/ts-migrate/blob/master/packages/ts-migrate-example/src).\nFor more information, please check the [plugins implementation](https://github.com/airbnb/ts-migrate/tree/master/packages/ts-migrate-plugins/src/plugins) for the _ts-migrate_.\n\n> I have an issue with a specific plugin, what should I do?\n\nPlease file an [issue here](https://github.com/airbnb/ts-migrate/issues/new).\n\n# Contributing\n\nSee the [Contributors Guide](https://github.com/airbnb/ts-migrate/blob/master/CONTRIBUTING.md).\n","readmeFilename":"README.md"}