Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CP-V6.x] Story #12110 prettier #1637

Merged
merged 6 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1648,6 +1648,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
4 changes: 2 additions & 2 deletions ui/ui-frontend-common/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ target
/*

# Except files in projects:
!/projects
!/src

# Ignore all given extensions files:
*.css
*.js
*.json

# Except json files in any assets folder
!**/assets/**/*.json
!**/assets/**/*.json
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