Skip to content

Commit

Permalink
Merge pull request #1628 from ProgrammeVitam/story_12110_prettier
Browse files Browse the repository at this point in the history
Story #12110 Prettier
  • Loading branch information
marob authored Feb 1, 2024
2 parents 67245f8 + 19ddfd5 commit 946e8c6
Show file tree
Hide file tree
Showing 1,964 changed files with 55,515 additions and 30,142 deletions.
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,17 @@
<arguments>install --legacy-peer-deps --loglevel warn</arguments>
</configuration>
</execution>
<execution>
<id>npm run prettier:ci</id>
<goals>
<goal>npm</goal>
</goals>
<phase>process-sources</phase>
<configuration>
<skip>${skipAllFrontend}</skip>
<arguments>run prettier:ci</arguments>
</configuration>
</execution>
<execution>
<id>npm run build</id>
<goals>
Expand Down
8 changes: 8 additions & 0 deletions ui/ui-frontend-common/.husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh
[ -n "$CI" ] && exit 0

. "$(dirname -- "$0")/_/husky.sh"

cd ui/ui-frontend-common/

npx lint-staged@13
43 changes: 43 additions & 0 deletions ui/ui-frontend-common/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,49 @@ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protrac

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

## IDE configuration

### VSCode

#### Recommended Extensions for VSCode

- "ms-vscode.vscode-typescript-tslint-plugin" : for more information: // TsLinst, https://marketplace.visualstudio.com/items?itemName=ms-vscode.
- "esbenp.prettier-vscode" : for more information: // Code formater Prettier, https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode
- "sibiraj-s.vscode-scss-formatter" : for more information: // SCSS Formatter, https://marketplace.visualstudio.com/items?itemName=sibiraj-s.vscode-scss-formatter
- "msjsdiag.debugger-for-chrome": for more information: // Debbuger for Chrome, https://marketplace.visualstudio.com/items?itemName=msjsdiag.debugger-for-chrome
- "firefox-devtools.vscode-firefox-debug" : for more information: // Debbuger for Firefox, https://marketplace.visualstudio.com/items?itemName=firefox-devtools.vscode-firefox-debug

#### VSCode settings

Bellow, an example to manage code format for Visual studio code using `settings.json` file:

```json5
{
"editor.formatOnSave": true,
"[typescript]": {
"editor.codeActionsOnSave": {
"source.fixAll.tslint": true,
"source.organizeImports": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
"search.exclude": {
"**/node_modules": true,
"**/dist": true,
},
}
```

### IntelliJ

- Enable "Automatic Prettier configuration", set `**/*.{js,ts,html,json,md,scss}` in "Run for files" and check the "Run on save" checkbox

# Common lib specific info

## Usage
Expand Down
Loading

0 comments on commit 946e8c6

Please sign in to comment.