Skip to content
This repository was archived by the owner on Nov 21, 2025. It is now read-only.

Commit 904d184

Browse files
committed
build: update to latest version of @angular/ng-dev and set up formatting
1 parent 82a0d48 commit 904d184

File tree

16 files changed

+2596
-6827
lines changed

16 files changed

+2596
-6827
lines changed

.ng-dev/format.mts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {FormatConfig} from '@angular/dev-infra-private/ng-dev';
1+
import {FormatConfig} from '@angular/ng-dev';
22

33
/**
44
* Configuration for the `ng-dev format` command.
55
*/
66
export const format: FormatConfig = {
7-
'clang-format': {
7+
'prettier': {
88
'matchers': [
99
'**/*.{js,ts}',
1010
],

.ng-dev/github.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {GithubConfig} from '@angular/dev-infra-private/ng-dev';
1+
import {GithubConfig} from '@angular/ng-dev';
22

33
/**
44
* Github configuration for the `ng-dev` toolset.

.ng-dev/pull-request.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {PullRequestConfig} from '@angular/dev-infra-private/ng-dev';
1+
import {PullRequestConfig} from '@angular/ng-dev';
22

33
/**
44
* Configuration for the merge tool in `ng-dev`. This sets up the labels which

.prettierignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.prettierrc
2+
pnpm-lock.yaml
3+
4+
5+
syntaxes/test/data/**

.prettierrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"embeddedLanguageFormatting": "off",
6+
"singleQuote": true,
7+
"semi": true,
8+
"quoteProps": "preserve",
9+
"bracketSpacing": false,
10+
"trailingComma": "all"
11+
}

.vscode/recommended-settings.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
"tslint.enable": true,
44
"typescript.tsc.autoDetect": "off",
55
"typescript.preferences.quoteStyle": "single",
6-
"//format-on-save-comment": "Format ts files on save with `clang-format.executable`. If `clang-format.executable` is not being used, this setting should be removed. You can instead run `pnpm format` to manually format your code.",
6+
"//format-on-save-comment": "Format You can instead run `pnpm format` to manually format your code.",
77
"[typescript]": {
88
"editor.formatOnSave": true
99
},
10-
"//clang-format-comment": "Please install https://marketplace.visualstudio.com/items?itemName=xaver.clang-format to take advantage of `clang-format` in VSCode. (See https://clang.llvm.org/docs/ClangFormat.html for more info `clang-format`.)",
11-
"clang-format.executable": "${workspaceRoot}/node_modules/.bin/clang-format"
1210
}

DEVELOPER.md

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -28,37 +28,8 @@ by running
2828

2929
## Formatting source code
3030

31-
This repository uses the [NPM distribution](https://www.npmjs.com/package/clang-format) of
32-
[`clang-format`](http://clang.llvm.org/docs/ClangFormat.html) to format source code.
33-
34-
Code is automatically formatted by running `pnpm format`. You can also set up your IDE to format
35-
files on each save.
36-
37-
### VS Code
38-
39-
1. Install the
40-
[`Clang-Format` extension](https://marketplace.visualstudio.com/items?itemName=xaver.clang-format)
41-
for VS Code.
42-
2. Copy [`.vscode/recommended-settings.json`](./.vscode/recommended-settings.json) to a new
43-
`.vscode/settings.json` file. VS Code will automatically pick up relevant formatting options for
44-
the workspace from this file.
45-
46-
### WebStorm / IntelliJ
47-
48-
1. Install the [`ClangFormatIJ`](https://plugins.jetbrains.com/plugin/8396-clangformatij) plugin for
49-
IntelliJ IDEs.
50-
2. Open `Preferences->Tools->clang-format`.
51-
3. Set the field named "PATH" to `<PATH_TO_REPOSITORY>/node_modules/.bin/`.
52-
53-
### Vim
54-
55-
1. Install [Vim Clang-Format](https://github.com/rhysd/vim-clang-format).
56-
2. Create a [project-specific `.vimrc`](https://andrew.stwrt.ca/posts/project-specific-vimrc/) in
57-
the repository root directory containing
58-
59-
```vim
60-
let g:clang_format#command = '<PATH_TO_REPOSITORY>/node_modules/.bin/clang-format'
61-
```
31+
This repository uses a common toolset provided in the angular organization for formatting, `ng-dev`. It is installed as a standard npm package,
32+
and can be run locally with `pnpm format`.
6233

6334
## Test Local Changes in VSCode
6435

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,11 @@
1-
import { Component } from '@angular/core';
1+
import {Component} from '@angular/core';
22

3-
@Component({
4-
selector: 'baz-component',
5-
template: `<h1>Hello {{name}}</h1>`,
6-
standalone: true
7-
})
3+
@Component({selector: 'baz-component', template: `<h1>Hello {{name}}</h1>`, standalone: true})
84
export class BazComponent {
9-
name = 'Angular';
5+
name = 'Angular';
106
}
117

12-
@Component({
13-
selector: 'bar-component',
14-
template: `<`,
15-
standalone: true
16-
})
8+
@Component({selector: 'bar-component', template: `<`, standalone: true})
179
export class BarComponent {
18-
name = 'Angular';
10+
name = 'Angular';
1911
}

integration/project/app/foo.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, signal } from '@angular/core';
1+
import {Component, signal} from '@angular/core';
22

33
@Component({
44
templateUrl: 'foo.component.html',

override_rename_ts_plugin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
module.exports = require("@angular/language-service/override_rename_ts_plugin").factory;
9+
module.exports = require('@angular/language-service/override_rename_ts_plugin').factory;

0 commit comments

Comments
 (0)