Skip to content

Commit 5e78a9d

Browse files
committed
fix(codemod): handle mid-line strong directive and skip out/ directories
- withoutDirective: drop ^ anchor and m flag so the regex matches a mid-line "use strong";\n inserted after a same-line block comment - IGNORED_DIRS: add 'out' (standard tsc outDir) so scanSourceFiles skips compiled output, restoring the behavior the local walker had
1 parent 0adb0e9 commit 5e78a9d

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

‎packages/cli/src/kernel/project.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const IGNORED_DIRS = new Set([
66
'node_modules',
77
'dist',
88
'build',
9+
'out',
910
'.git',
1011
'coverage',
1112
'.next',

‎packages/codemod/src/strong.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import { finding, thrown } from './compiler.js';
2121
*/
2222
function withoutDirective(code) {
2323
const top = '"use strong";\n\n';
24-
return code.startsWith(top) ? code.slice(top.length) : code.replace(/^"use strong";\n/m, '');
24+
return code.startsWith(top) ? code.slice(top.length) : code.replace(/"use strong";\n/, '');
2525
}
2626
const MAX_ROUNDS = 6;
2727

0 commit comments

Comments
 (0)