Skip to content

Commit

Permalink
feat(@angular/cli): Add VsCode recommendation for Angular Console
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmeku authored and mgechev committed Feb 26, 2019
1 parent b96e7bf commit 3d6ae63
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ export default function (): Rule {
const addExtensionRecommendations = updateJsonInTree(
'.vscode/extensions.json',
(json: { recommendations?: string[] }) => {
['angular.ng-template', 'ms-vscode.vscode-typescript-tslint-plugin'].forEach(extension => {
json.recommendations = json.recommendations || [];
if (!json.recommendations.includes(extension)) {
json.recommendations.push(extension);
}
});
[
'angular.ng-template',
'nrwl.angular-console',
'ms-vscode.vscode-typescript-tslint-plugin'].forEach(extension => {
json.recommendations = json.recommendations || [];
if (!json.recommendations.includes(extension)) {
json.recommendations.push(extension);
}
});

return json;
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ describe('Update 8.0.0', () => {
.toPromise();

expect(readJsonInTree(result, '.vscode/extensions.json')).toEqual({
recommendations: ['angular.ng-template', 'ms-vscode.vscode-typescript-tslint-plugin'],
recommendations: [
'angular.ng-template', 'nrwl.angular-console', 'ms-vscode.vscode-typescript-tslint-plugin'],
});
});

Expand All @@ -44,7 +45,10 @@ describe('Update 8.0.0', () => {
.callRule(
updateJsonInTree('.vscode/extensions.json', () => ({
recommendations: [
'eamodio.gitlens', 'angular.ng-template', 'ms-vscode.vscode-typescript-tslint-plugin'],
'eamodio.gitlens',
'angular.ng-template',
'nrwl.angular-console',
'ms-vscode.vscode-typescript-tslint-plugin'],
})),
initialTree,
)
Expand All @@ -56,7 +60,10 @@ describe('Update 8.0.0', () => {

expect(readJsonInTree(result, '.vscode/extensions.json')).toEqual({
recommendations: [
'eamodio.gitlens', 'angular.ng-template', 'ms-vscode.vscode-typescript-tslint-plugin'],
'eamodio.gitlens',
'angular.ng-template',
'nrwl.angular-console',
'ms-vscode.vscode-typescript-tslint-plugin'],
});
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"angular.ng-template",
"nrwl.angular-console",
"ms-vscode.vscode-typescript-tslint-plugin"
]
}

0 comments on commit 3d6ae63

Please sign in to comment.