GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - lingui/codemods: Collection of codemods for LinguiJS

BranchesTags
Open more actions menu

Latest commit

 

History

88 Commits
88 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.husky
.husky
 
 
bin
bin
 
 
transforms
transforms
 
 
.gitignore
.gitignore
 
 
.prettierignore
.prettierignore
 
 
.prettierrc.json
.prettierrc.json
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
jest.config.js
jest.config.js
 
 
package.json
package.json
 
 
release.config.js
release.config.js
 
 
tsconfig.json
tsconfig.json
 
 
tsconfig.spec.json
tsconfig.spec.json
 
 
types.d.ts
types.d.ts
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

Linguijs Codemods

This repository contains a collection of codemod scripts for use with JSCodeshift that help update Lingui APIs.


Usage

npx @lingui/codemods <transform> <path> [...options]

  • transform - name of transform, see available transforms below.
  • path - files or directory to transform
  • use the --dry option for a dry-run
  • use --print to print the output for comparison
  • use --remove-unused-imports to remove unused imports once finished the codemod

This will start an interactive wizard, and then run the specified transform.

Included Transforms

v2-to-v3

Converts some outdated standards from lingui version 2.x.x to new features and best practices introduced in lingui version 3.x.x

npx @lingui/codemods v2-to-v3 <path>

split-macro-imports

Converts @lingui/macro imports to @lingui/core/macro and @lingui/react/macro.

npx @lingui/codemods split-macro-imports <path>

Visit the Migration guide from 4.x to 5.x for more information.

jscodeshift options

To pass more options directly to jscodeshift, use --jscodeshift="...". For example:

npx @lingui/codemods --jscodeshift="--run-in-band --verbose=2"

See all available options here.

Recast Options

Options to recast's printer can be provided through jscodeshift's printOptions command line argument

npx @lingui/codemods <transform> <path> --jscodeshift="--printOptions='{\"quote\":\"double\"}'"

Usage without params

A CLI is built-in to help you migrate your codebase, will ask you some questions:

➜  project git:(master) npx @lingui/codemods
? On which files or directory should the codemods be applied? for ex: ./src
? Which dialect of JavaScript do you use? for ex: JavaScript | Typescript | JavaScript with Flow
? Which transform would you like to apply? for ex: `v2-to-v3`

License

@lingui/codemods is MIT licensed.

About

Collection of codemods for LinguiJS

Topics

codemodsjscodeshiftlingui

Resources

Readme
MIT license

Code of conduct

Code of conduct

Security policy

Security policy
Activity
Custom properties

Stars

4 stars

Watchers

3 watching

Forks

3 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.