Skip to content

Commit 453df3f

Browse files
authored
Autofix imports when running replace-fork (#20251)
* Pass extra CLI args through to ESLint These now work: ``` yarn run lint --fix yarn run linc --fix ``` * Autofix imports when running replace-fork We have a custom ESLint rule that can autofix cross-fork imports. Usually, after running the `replace-fork` script, you need to run `yarn lint --fix` to fix the imports. This combines the two steps into one.
1 parent 73bf2d6 commit 453df3f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/merge-fork/replace-fork.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
const {promisify} = require('util');
88
const glob = promisify(require('glob'));
9+
const {spawnSync} = require('child_process');
910
const fs = require('fs');
1011

1112
const stat = promisify(fs.stat);
@@ -14,6 +15,9 @@ const copyFile = promisify(fs.copyFile);
1415
async function main() {
1516
const oldFilenames = await glob('packages/react-reconciler/**/*.old.js');
1617
await Promise.all(oldFilenames.map(unforkFile));
18+
19+
// Use ESLint to autofix imports
20+
spawnSync('yarn', ['linc', '--fix']);
1721
}
1822

1923
async function unforkFile(oldFilename) {

0 commit comments

Comments
 (0)