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

[i18n] add option to disable duplicate id check #867

Closed
2 tasks done
marcuskrahl opened this issue Jan 12, 2022 · 0 comments · Fixed by #868
Closed
2 tasks done

[i18n] add option to disable duplicate id check #867

marcuskrahl opened this issue Jan 12, 2022 · 0 comments · Fixed by #868
Labels
package: eslint-plugin-template Angular Template rules triage This issue needs to be looked at and categorized by a maintainer

Comments

@marcuskrahl
Copy link
Contributor

Description and reproduction of the issue

Currently the i18n rule will always report errors when custom ids are used multiple times.

However there may be cases where this is not desired, for example when using common labels throughout the application

<button type="button" i18n="@@common.cancel-label">Cancel</button>

<!-- later in the same file-->

<button type="button" i18n="@@common.cancel-label">Cancel</button>

Angular already reports duplicate ids which do not have the same content. So an option should be introduced to disable the duplicate id check.

{
  "rules": {
    "@angular-eslint/template/i18n": ["warn"]
  }
}

Versions

package version
@angular-eslint/eslint-plugin-template 13.0.1
@angular-eslint/template-parser 13.0.1
@typescript-eslint/parser 4.33.0
ESLint 7.32.0
node 14.18.2
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest supported version of the packages and checked my ng version output per the instructions given here.
@marcuskrahl marcuskrahl added package: eslint-plugin-template Angular Template rules triage This issue needs to be looked at and categorized by a maintainer labels Jan 12, 2022
marcuskrahl pushed a commit to marcuskrahl/angular-eslint that referenced this issue Jan 12, 2022
This adds an option to the i18n linting rule in order to oppress duplice id reports

fix angular-eslint#867
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: eslint-plugin-template Angular Template rules triage This issue needs to be looked at and categorized by a maintainer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant