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

Override values from settings-file via CLI #155

Open
saschakr opened this issue Apr 29, 2024 · 0 comments
Open

Override values from settings-file via CLI #155

saschakr opened this issue Apr 29, 2024 · 0 comments

Comments

@saschakr
Copy link

Feature request

Motivation

I have a mono-repo and would like to have a common settings file for all apps.
It would be nice if I could override the project and languages properties per app. (eg in ci/cd)

Solution

It would be nice to have a settings file like:

{
    "rules": {
        "keysOnViews": "error",
        "zombieKeys": "warning",
        "misprintKeys": "disable",
        "deepSearch": "disable",
        "emptyKeys": "warning",
        "maxWarning": "0",
        "misprintCoefficient": "0.9",
        "ignoredKeys": [ "IGNORED.KEY.(.*)" ], // can be string or RegExp
        "ignoredMisprintKeys": [],
        "customRegExpToFindKeys": [ "(?<=marker\\(['\"])([A-Za-z0-9_\\-.]+)(?=['\"]\\))"], // to find: marker('TRSNLATE.KEY');
    }
}

and call it like:

ngx-translate-lint --config ./ng-translate-lint.conf.json \
            --project   './apps/app-1/src/app/**/*.{html,ts}' \
            --languages './apps/app-1/src/assets/i18n/*.json' 

or

ngx-translate-lint --config ./ng-translate-lint.conf.json \
            --project   './apps/app-2/src/app/**/*.{html,ts}' \
            --languages './apps/app-2/src/assets/i18n/*.json' 

Currently this command only print the help text.
So cli options should override the settings from config file.

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

No branches or pull requests

1 participant