Skip to content

Commit 59c8e18

Browse files
authored
fix(angular): add --skip-format for convert-tslint-to-eslint (#6387)
1 parent 1ee463a commit 59c8e18

File tree

16 files changed

+88
-4
lines changed

16 files changed

+88
-4
lines changed

docs/angular/api-angular/generators/convert-tslint-to-eslint.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,11 @@ Default: `true`
6565
Type: `boolean`
6666

6767
If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.
68+
69+
### skipFormat
70+
71+
Default: `false`
72+
73+
Type: `boolean`
74+
75+
Skip formatting files.

docs/angular/api-nest/generators/convert-tslint-to-eslint.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ Default: `true`
5353
Type: `boolean`
5454

5555
If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.
56+
57+
### skipFormat
58+
59+
Default: `false`
60+
61+
Type: `boolean`
62+
63+
Skip formatting files.

docs/node/api-angular/generators/convert-tslint-to-eslint.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,11 @@ Default: `true`
6565
Type: `boolean`
6666

6767
If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.
68+
69+
### skipFormat
70+
71+
Default: `false`
72+
73+
Type: `boolean`
74+
75+
Skip formatting files.

docs/node/api-nest/generators/convert-tslint-to-eslint.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ Default: `true`
5353
Type: `boolean`
5454

5555
If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.
56+
57+
### skipFormat
58+
59+
Default: `false`
60+
61+
Type: `boolean`
62+
63+
Skip formatting files.

docs/react/api-angular/generators/convert-tslint-to-eslint.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,11 @@ Default: `true`
6565
Type: `boolean`
6666

6767
If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.
68+
69+
### skipFormat
70+
71+
Default: `false`
72+
73+
Type: `boolean`
74+
75+
Skip formatting files.

docs/react/api-nest/generators/convert-tslint-to-eslint.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,11 @@ Default: `true`
5353
Type: `boolean`
5454

5555
If this conversion leaves no more TSLint usage in the workspace, it will remove TSLint and related dependencies and configuration.
56+
57+
### skipFormat
58+
59+
Default: `false`
60+
61+
Type: `boolean`
62+
63+
Skip formatting files.

packages/angular/src/generators/add-linting/add-linting.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ export async function addLintingGenerator(
1414
addAngularEsLintDependencies(tree);
1515
createEsLintConfiguration(tree, options);
1616
addProjectLintTarget(tree, options);
17-
await formatFiles(tree);
17+
18+
if (!options.skipFormat) {
19+
await formatFiles(tree);
20+
}
1821

1922
return installTask;
2023
}

packages/angular/src/generators/add-linting/schema.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ export interface AddLintingGeneratorSchema {
33
projectRoot: string;
44
prefix: string;
55
setParserOptionsProject?: boolean;
6+
skipFormat?: boolean;
67
}

packages/angular/src/generators/add-linting/schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@
2222
"type": "boolean",
2323
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
2424
"default": false
25+
},
26+
"skipFormat": {
27+
"type": "boolean",
28+
"description": "Skip formatting files.",
29+
"default": false
2530
}
2631
},
2732
"additionalProperties": false,

packages/angular/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export async function conversionGenerator(
3939
* does and remove the config again if it doesn't, so that it is most efficient.
4040
*/
4141
setParserOptionsProject: true,
42+
skipFormat: options.skipFormat,
4243
});
4344
},
4445
});
@@ -103,6 +104,7 @@ export async function conversionGenerator(
103104
* step of this parent generator, if applicable
104105
*/
105106
removeTSLintIfNoMoreTSLintTargets: false,
107+
skipFormat: options.skipFormat,
106108
});
107109
} catch {
108110
logger.warn(
@@ -122,7 +124,9 @@ export async function conversionGenerator(
122124
uninstallTSLintTask = projectConverter.removeTSLintFromWorkspace();
123125
}
124126

125-
await formatFiles(host);
127+
if (!options.skipFormat) {
128+
await formatFiles(host);
129+
}
126130

127131
return async () => {
128132
await eslintInitInstallTask();

0 commit comments

Comments
 (0)