Skip to content

Commit 99b14da

Browse files
committed
.
1 parent 336a01a commit 99b14da

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,19 @@ jobs:
196196
env:
197197
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
198198

199+
test-codemods:
200+
runs-on: ubuntu-latest
201+
name: Test
202+
steps:
203+
- name: Checkout
204+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
205+
206+
- name: Setup Node.js and deps
207+
uses: ./.github/actions/setup-deps
208+
209+
- name: Test
210+
run: yarn test:codemods
211+
199212
test-rn-0-83-1:
200213
runs-on: ubuntu-latest
201214
name: Test RN 0.83.1

codemods/v14-async-functions/scripts/codemod.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,7 @@ interface CodemodOptions {
208208
};
209209
}
210210

211-
function parseCustomRenderFunctionsFromOptions(
212-
options?: CodemodOptions,
213-
): Set<string> {
211+
function parseCustomRenderFunctionsFromOptions(options?: CodemodOptions): Set<string> {
214212
const customRenderFunctionsParam = options?.params?.customRenderFunctions
215213
? String(options.params.customRenderFunctions)
216214
: '';
@@ -767,8 +765,6 @@ function findResultMethodCalls(
767765
return functionCalls;
768766
}
769767

770-
771-
772768
/**
773769
* Automatically detects custom render functions by analyzing the code structure.
774770
* A custom render function is identified as:
@@ -1123,9 +1119,7 @@ function isFunctionAlreadyAsync(func: SgNode<TSX>): boolean {
11231119
const functionKeywordIndex = children.findIndex((child) => child.text() === 'function');
11241120
if (functionKeywordIndex > 0) {
11251121
// Check if any child before 'function' is 'async'
1126-
return children
1127-
.slice(0, functionKeywordIndex)
1128-
.some((child) => child.text() === 'async');
1122+
return children.slice(0, functionKeywordIndex).some((child) => child.text() === 'async');
11291123
}
11301124
// Also check if the first child is 'async'
11311125
return children.length > 0 && children[0].text() === 'async';

codemods/v14-update-deps/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ npx codemod@latest run rntl-v14-update-deps --target ./path/to/your/project
1919
## Example
2020

2121
**Before:**
22+
2223
```json
2324
{
2425
"dependencies": {
@@ -32,6 +33,7 @@ npx codemod@latest run rntl-v14-update-deps --target ./path/to/your/project
3233
```
3334

3435
**After:**
36+
3537
```json
3638
{
3739
"devDependencies": {

0 commit comments

Comments
 (0)