Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8c8ced

Browse files
committed
fix: remove file formatting from schematics, instead print a console log
1 parent 78a79e2 commit c8c8ced

File tree

6 files changed

+12
-207
lines changed

6 files changed

+12
-207
lines changed

libs/cdk/schematics/src/utils/format-files.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

libs/cdk/schematics/src/utils/renaming-rule.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
saveActiveProject,
1010
setActiveProject,
1111
} from 'ng-morph';
12-
import { formatFiles } from './format-files';
1312

1413
type ImportConfig = Pick<ImportSpecifierStructure, 'alias' | 'name'>;
1514
type RenameConfig = Record<string, string | [string, string]>;
@@ -20,6 +19,9 @@ export function renamingRule(packageName: Pattern, renames: RenameConfig) {
2019
return (): Rule => {
2120
return chain([
2221
(tree: Tree) => {
22+
console.log(
23+
'Migration schematics might cause your code to be formatted incorrectly. Make sure to run your formatter of choice after the migration.',
24+
);
2325
setActiveProject(createProject(tree, '/', ['**/*.ts']));
2426

2527
const imports = getImports('**/*.ts', {
@@ -79,15 +81,14 @@ export function renamingRule(packageName: Pattern, renames: RenameConfig) {
7981

8082
saveActiveProject();
8183
},
82-
formatFiles(),
8384
]);
8485
};
8586
}
8687

8788
function renameReferences(
8889
importSpecifier: ImportSpecifier,
8990
oldName: string,
90-
newName: string
91+
newName: string,
9192
) {
9293
importSpecifier
9394
.getNameNode()

libs/state/schematics/src/utils/format-files.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

libs/state/schematics/src/utils/renaming-rule.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
saveActiveProject,
1010
setActiveProject,
1111
} from 'ng-morph';
12-
import { formatFiles } from './format-files';
1312

1413
type ImportConfig = Pick<ImportSpecifierStructure, 'alias' | 'name'>;
1514
type RenameConfig = Record<string, string | [string, string]>;
@@ -20,6 +19,9 @@ export function renamingRule(packageName: Pattern, renames: RenameConfig) {
2019
return (): Rule => {
2120
return chain([
2221
(tree: Tree) => {
22+
console.log(
23+
'Migration schematics might cause your code to be formatted incorrectly. Make sure to run your formatter of choice after the migration.',
24+
);
2325
setActiveProject(createProject(tree, '/', ['**/*.ts']));
2426

2527
const imports = getImports('**/*.ts', {
@@ -79,15 +81,14 @@ export function renamingRule(packageName: Pattern, renames: RenameConfig) {
7981

8082
saveActiveProject();
8183
},
82-
formatFiles(),
8384
]);
8485
};
8586
}
8687

8788
function renameReferences(
8889
importSpecifier: ImportSpecifier,
8990
oldName: string,
90-
newName: string
91+
newName: string,
9192
) {
9293
importSpecifier
9394
.getNameNode()

libs/template/schematics/src/utils/format-files.ts

Lines changed: 0 additions & 66 deletions
This file was deleted.

libs/template/schematics/src/utils/renaming-rule.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import {
99
saveActiveProject,
1010
setActiveProject,
1111
} from 'ng-morph';
12-
import { formatFiles } from './format-files';
1312

1413
type ImportConfig = Pick<ImportSpecifierStructure, 'alias' | 'name'>;
1514
type RenameConfig = Record<string, string | [string, string]>;
@@ -20,6 +19,9 @@ export function renamingRule(packageName: Pattern, renames: RenameConfig) {
2019
return (): Rule => {
2120
return chain([
2221
(tree: Tree) => {
22+
console.log(
23+
'Migration schematics might cause your code to be formatted incorrectly. Make sure to run your formatter of choice after the migration.',
24+
);
2325
setActiveProject(createProject(tree, '/', ['**/*.ts']));
2426

2527
const imports = getImports('**/*.ts', {
@@ -79,15 +81,14 @@ export function renamingRule(packageName: Pattern, renames: RenameConfig) {
7981

8082
saveActiveProject();
8183
},
82-
formatFiles(),
8384
]);
8485
};
8586
}
8687

8788
function renameReferences(
8889
importSpecifier: ImportSpecifier,
8990
oldName: string,
90-
newName: string
91+
newName: string,
9192
) {
9293
importSpecifier
9394
.getNameNode()

0 commit comments

Comments
 (0)