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

feat: add JSON lint check for i18n folder #21687

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davutkilic
Copy link

Comprehensive Summary of your change
Added a new GitHub Actions workflow (json-lint.yml) to validate all JSON files in src/portal/src/i18n/.
This ensures any malformed JSON will cause the CI to fail, preventing invalid translations from being merged.
Issue being fixed
Fixes #21685

Checklist
Well Written Title and Summary of the PR
Example: “feat: add JSON lint check for i18n folder”
Label the PR as needed
Choose an appropriate label such as release-note/new-feature or release-note/enhancement.
Accepted the DCO
Make sure all your commits include the Signed-off-by: Your Name [email protected] line.
Tests are passing and test coverage is added if needed
The JSON lint check is run in the new workflow.
Docs impact
No separate docs change needed, since this is an internal CI improvement.

@davutkilic davutkilic requested a review from a team as a code owner March 3, 2025 14:55
@davutkilic davutkilic force-pushed the feature/json-lint-check branch from 16da18d to 91e11a1 Compare March 3, 2025 15:54
- name: Run JSON lint
run: |
# Alle JSON-Dateien im i18n-Ordner suchen
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you write the comment in English?

@davutkilic davutkilic force-pushed the feature/json-lint-check branch from 9bf55a8 to 1bb871b Compare March 4, 2025 10:35
@davutkilic
Copy link
Author

Translated it into English

Copy link
Contributor

@bupd bupd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can already have this just by introducing a new plugin to es lint. and let the lint take care of this rather than having a new CI workflow for checking json.

Copy link
Contributor

@bupd bupd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the below to the .eslintrc.json

    {
      "files": ["*.html"],
      "excludedFiles": ["*inline-template-*.component.html"],
      "extends": ["plugin:prettier/recommended"],
      "rules": {
        "prettier/prettier": ["error", { "parser": "angular" }]
      }
    },
+    {
+     "files": ["*.json"],
+      "extends": [
+        "plugin:json/recommended-legacy",
+        "plugin:prettier/recommended"
+      ],
+      "rules": {
+        "json/*": ["error"],
+        "prettier/prettier": ["error", { "parser": "angular" }]
+      }
+    }

Hope this helps

@bupd
Copy link
Contributor

bupd commented Mar 4, 2025

Also don't forget: npm install eslint-plugin-json
Adding a lint rule as suggested above would easily fix this issue.

Thanks

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.

Missing Lint Check for Invalid JSON Files in i18n
6 participants