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

Prettier (Installation + Settings) #262

Merged
merged 4 commits into from
Aug 30, 2024
Merged

Prettier (Installation + Settings) #262

merged 4 commits into from
Aug 30, 2024

Conversation

seicke
Copy link
Member

@seicke seicke commented Aug 29, 2024

Preparatory work for the later use of Prettier

@seicke
Copy link
Member Author

seicke commented Aug 29, 2024

GitHub Action for format checking with Prettier:

name: Check formatting

on:
  pull_request:
    branches: [main]

jobs:
  prettier:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout
        uses: actions/checkout@v3
        with:
          fetch-depth: 0
          ref: ${{ github.head_ref }}
          persist-credentials: false

      - name: Prettify code
        uses: creyD/prettier_action@v4.3
        with:
          dry: True
          working_directory: ./aas-gui/Frontend/aas-web-gui
          prettier_options: --check src/
          github_token: ${{ github.token }}

@seicke seicke requested a review from aaronzi August 29, 2024 14:13
aas-gui/Frontend/aas-web-gui/.prettierrc Outdated Show resolved Hide resolved
@aaronzi
Copy link
Member

aaronzi commented Aug 29, 2024

As a suggestion for prettier config to differentiate between different file types:

{
    "trailingComma": "es5",
    "tabWidth": 4,
    "useTabs": false,
    "semi": true,
    "singleQuote": true,
    "bracketSpacing": true,
    "bracketSameLine": true,
    "arrowParens": "always",
    "vueIndentScriptAndStyle": true,
    "printWidth": 120,

    "overrides": [
        {
            "files": "*.ts",
            "options": {
                "parser": "typescript"
            }
        },
        {
            "files": "*.vue",
            "options": {
                "parser": "vue",
                "vueIndentScriptAndStyle": true
            }
        },
        {
            "files": "*.json",
            "options": {
                "parser": "json",
                "tabWidth": 2,
                "trailingComma": "none"
            }
        },
        {
            "files": "*.js",
            "options": {
                "parser": "babel"
            }
        },
        {
            "files": "*.md",
            "options": {
                "proseWrap": "always"
            }
        },
        {
            "files": "*.css",
            "options": {
                "parser": "css"
            }
        },
        {
            "files": "*.yaml",
            "options": {
                "parser": "yaml",
                "tabWidth": 2
            }
        }
    ]
}

@seicke seicke requested a review from aaronzi August 30, 2024 04:50
@aaronzi aaronzi merged commit 9eaa933 into eclipse-basyx:main Aug 30, 2024
2 checks passed
@seicke seicke deleted the prettier branch August 30, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants