Skip to content

Commit 909c3f7

Browse files
committed
port remove-legacy-context
1 parent c7468e0 commit 909c3f7

26 files changed

Lines changed: 713 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# remove-legacy-context
2+
3+
Remove legacy `childContextTypes` and `getChildContext()` usage from React class components and wrap rendered JSX with a new context.
4+
5+
## Usage
6+
7+
```bash
8+
npx codemod @react-new/remove-legacy-context --target <path>
9+
```
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
schema_version: "1.0"
2+
3+
name: "@react-new/remove-legacy-context"
4+
version: "0.1.1"
5+
description: "Remove legacy childContextTypes/getChildContext usage from React class components"
6+
author: "Codemod <hello@codemod.com>"
7+
license: "MIT"
8+
workflow: "workflow.yaml"
9+
repository: "https://github.com/codemod/jssg-react-codemods/tree/main/codemods/remove-legacy-context"
10+
11+
targets:
12+
languages: ["tsx"]
13+
14+
keywords: ["React", "Context", "Legacy"]
15+
16+
registry:
17+
access: "public"
18+
visibility: "private"
19+
20+
capabilities: []
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@react-new/remove-legacy-context",
3+
"version": "0.1.1",
4+
"description": "Remove legacy childContextTypes/getChildContext usage from React class components",
5+
"type": "module",
6+
"scripts": {
7+
"test": "pnpm dlx codemod@latest jssg test -l tsx ./scripts/codemod.ts",
8+
"check-types": "tsc --noEmit"
9+
},
10+
"devDependencies": {
11+
"@codemod.com/jssg-types": "latest",
12+
"@types/node": "latest",
13+
"typescript": "latest"
14+
}
15+
}

0 commit comments

Comments
 (0)