You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+228-2Lines changed: 228 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,236 @@ This project was generated using [Angular CLI](https://github.com/angular/angula
7
7
To start a local development server, run:
8
8
9
9
```bash
10
-
ng serve
10
+
npm run develop
11
11
```
12
12
13
-
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
13
+
Once the server is running, open your browser and navigate to `http://localhost:3026/`. The application will automatically reload whenever you modify any of the source files.
14
+
15
+
## Cloning Guide
16
+
17
+
1. Clone only the remote primary HEAD (default: origin/main)
## Automate using `Prettier`, `Es Lint` and `Husky`
61
+
62
+
1. Install the compatible node version
63
+
64
+
```bash
65
+
nvm install v24.16.0
66
+
```
67
+
68
+
2. Install and Configure Prettier
69
+
- Install prettier as below:
70
+
71
+
```bash
72
+
npm install prettier -D
73
+
```
74
+
75
+
- Create a `.prettierrc.yml` file and write down the format as below: - [online ref](https://prettier.io/docs/en/options.html)
76
+
77
+
```yml
78
+
trailingComma: 'all'
79
+
tabWidth: 2
80
+
useTabs: false
81
+
semi: true
82
+
singleQuote: true
83
+
bracketSpacing: true
84
+
bracketSameLine: true
85
+
arrowParens: 'avoid'
86
+
printWidth: 120
87
+
overrides:
88
+
- files:
89
+
- '*.js'
90
+
- '*.jsx'
91
+
options:
92
+
bracketSpacing: true
93
+
jsxSingleQuote: true
94
+
semi: true
95
+
singleQuote: true
96
+
tabWidth: 2
97
+
useTabs: false
98
+
- files:
99
+
- '*.ts'
100
+
options:
101
+
tabWidth: 2
102
+
```
103
+
104
+
- Create a `.prettierignore` file and write as below(sample)
105
+
106
+
```gitignore
107
+
# Ignore artifacts:
108
+
build
109
+
coverage
110
+
e2e
111
+
node_modules
112
+
dist
113
+
dest
114
+
reports
115
+
116
+
# Ignore files
117
+
*.lock
118
+
package-lock.json
119
+
yarn.lock
120
+
```
121
+
122
+
3. Install `Es Lint`, if not installed
123
+
124
+
```bash
125
+
ng add @angular-eslint/schematics
126
+
```
127
+
128
+
if error comes, use the below command
129
+
130
+
```shell
131
+
ng add @angular-eslint/schematics@22.0.0
132
+
# or
133
+
ng add @angular-eslint/schematics@next
134
+
```
135
+
136
+
4. Configure pre-commit hooks
137
+
138
+
Pre-commit hooks are a nice way to run certain checks to ensure clean code. This can be used to format staged files if for some reason they weren’t automatically formatted during editing. [husky](https://github.com/typicode/husky) can be used to easily configure git hooks to prevent bad commits. We will use this along with [pretty-quick](https://github.com/azz/pretty-quick) to run Prettier on our changed files. Install these packages, along with [npm-run-all](https://github.com/mysticatea/npm-run-all), which will make it easier for us to run npm scripts:
139
+
140
+
```bash
141
+
npm install -D husky pretty-quick npm-run-all
142
+
```
143
+
144
+
To configure the pre-commit hook, simply add a `precommit` npm script. We want to first run Prettier, then run TSLint on the formatted files. To make our scripts cleaner, I am using the npm-run-all package, which gives you two commands, `run-s` to run scripts in sequence, and `run-p` to run scripts in parallel:
0 commit comments