@@ -35,8 +35,7 @@ export default function (): Rule {
35
35
return ( host , context ) => {
36
36
const logger = context . logger ;
37
37
38
- const tsConfig = new JSONFile ( host , 'tsconfig.json' ) ;
39
- const files = tsConfig . get ( [ 'files' ] ) ;
38
+ const files = new JSONFile ( host , 'tsconfig.json' ) . get ( [ 'files' ] ) ;
40
39
if ( ! ( Array . isArray ( files ) && files . length === 0 ) ) {
41
40
logger . info ( 'Migration has already been executed.' ) ;
42
41
@@ -51,16 +50,15 @@ export default function (): Rule {
51
50
// Iterate over all tsconfig files and change the extends from 'tsconfig.base.json' to 'tsconfig.json'.
52
51
const extendsJsonPath = [ 'extends' ] ;
53
52
for ( const path of visitExtendedJsonFiles ( host . root ) ) {
54
- const tsConfigDir = dirname ( normalize ( path ) ) ;
55
- let tsConfigJson ;
56
53
57
54
try {
58
- tsConfigJson = new JSONFile ( host , path ) ;
55
+ const tsConfigDir = dirname ( normalize ( path ) ) ;
56
+ const tsConfigJson = new JSONFile ( host , path ) ;
59
57
const extendsValue = tsConfigJson . get ( extendsJsonPath ) ;
60
58
61
59
if ( typeof extendsValue === 'string' && '/tsconfig.base.json' === resolve ( tsConfigDir , normalize ( extendsValue ) ) ) {
62
60
// tsconfig extends the workspace tsconfig path.
63
- tsConfig . modify ( extendsJsonPath , extendsValue . replace ( 'tsconfig.base.json' , 'tsconfig.json' ) ) ;
61
+ tsConfigJson . modify ( extendsJsonPath , extendsValue . replace ( 'tsconfig.base.json' , 'tsconfig.json' ) ) ;
64
62
}
65
63
} catch ( error ) {
66
64
logger . warn (
0 commit comments