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
fix(i18n): No longer throws exception when compiler returns null i18n description #892
fix(i18n): No longer throws exception when compiler returns null i18n description #892
Conversation
☁️ Nx Cloud ReportCI ran the following commands for commit 88b32c9. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch ✅ Successfully ran 7 targets
Sent with 💌 from NxCloud. |
@@ -422,7 +422,7 @@ function isBooleanLike(value: string): value is 'false' | 'true' { | |||
} | |||
|
|||
function isEmpty(value: string) { | |||
return value.trim().length === 0; | |||
return value == null || value.trim().length === 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be worth to have something like the following?
if (!!value) {
return value.trim().length === 0;
}
return true;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose that could save us some unnecessary calls to trim
, so it might be slightly more performant.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## master #892 +/- ##
==========================================
+ Coverage 86.33% 86.34% +0.01%
==========================================
Files 145 145
Lines 2715 2717 +2
Branches 436 437 +1
==========================================
+ Hits 2344 2346 +2
Misses 220 220
Partials 151 151
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Thanks @jamjarvi! |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular-eslint/builder](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`13.0.1` -> `13.1.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2fbuilder/13.0.1/13.1.0) | | [@angular-eslint/eslint-plugin](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`13.0.1` -> `13.1.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2feslint-plugin/13.0.1/13.1.0) | | [@angular-eslint/eslint-plugin-template](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`13.0.1` -> `13.1.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2feslint-plugin-template/13.0.1/13.1.0) | | [@angular-eslint/schematics](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`13.0.1` -> `13.1.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2fschematics/13.0.1/13.1.0) | | [@angular-eslint/template-parser](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`13.0.1` -> `13.1.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2ftemplate-parser/13.0.1/13.1.0) | --- ### Release Notes <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/builder)</summary> ### [`v13.1.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/builder/CHANGELOG.md#​1310-httpsgithubcomangular-eslintangular-eslintcomparev1301v1310-2022-02-13) [Compare Source](angular-eslint/angular-eslint@v13.0.1...v13.1.0) **Note:** Version bump only for package [@​angular-eslint/builder](https://github.com/angular-eslint/builder) #### [13.0.1](angular-eslint/angular-eslint@v13.0.0...v13.0.1) (2021-11-19) **Note:** Version bump only for package [@​angular-eslint/builder](https://github.com/angular-eslint/builder) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/eslint-plugin)</summary> ### [`v13.1.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#​1310-httpsgithubcomangular-eslintangular-eslintcomparev1301v1310-2022-02-13) [Compare Source](angular-eslint/angular-eslint@v13.0.1...v13.1.0) ##### Bug Fixes - rule docs links in create-eslint-rule utils ([#​907](angular-eslint/angular-eslint#907)) ([94f6e21](angular-eslint/angular-eslint@94f6e21)) #### [13.0.1](angular-eslint/angular-eslint@v13.0.0...v13.0.1) (2021-11-19) **Note:** Version bump only for package [@​angular-eslint/eslint-plugin](https://github.com/angular-eslint/eslint-plugin) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/eslint-plugin-template)</summary> ### [`v13.1.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/eslint-plugin-template/CHANGELOG.md#​1310-httpsgithubcomangular-eslintangular-eslintcomparev1301v1310-2022-02-13) [Compare Source](angular-eslint/angular-eslint@v13.0.1...v13.1.0) ##### Bug Fixes - **eslint-plugin-template:** \[i18n] do not throw when compiler returns null i18n description ([#​892](angular-eslint/angular-eslint#892)) ([d349149](angular-eslint/angular-eslint@d349149)) - rule docs links in create-eslint-rule utils ([#​907](angular-eslint/angular-eslint#907)) ([94f6e21](angular-eslint/angular-eslint@94f6e21)) ##### Features - **eslint-plugin-template:** \[i18n] add checkDuplicateId option ([#​868](angular-eslint/angular-eslint#868)) ([edaf46f](angular-eslint/angular-eslint@edaf46f)) - update angular/compiler to v13.2.2 ([#​834](angular-eslint/angular-eslint#834)) ([9847978](angular-eslint/angular-eslint@9847978)) #### [13.0.1](angular-eslint/angular-eslint@v13.0.0...v13.0.1) (2021-11-19) **Note:** Version bump only for package [@​angular-eslint/eslint-plugin-template](https://github.com/angular-eslint/eslint-plugin-template) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/schematics)</summary> ### [`v13.1.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/schematics/CHANGELOG.md#​1310-httpsgithubcomangular-eslintangular-eslintcomparev1301v1310-2022-02-13) [Compare Source](angular-eslint/angular-eslint@v13.0.1...v13.1.0) ##### Bug Fixes - update dependency ignore to v5.2.0 ([#​913](angular-eslint/angular-eslint#913)) ([5480102](angular-eslint/angular-eslint@5480102)) ##### Features - update angular/compiler to v13.2.2 ([#​834](angular-eslint/angular-eslint#834)) ([9847978](angular-eslint/angular-eslint@9847978)) #### [13.0.1](angular-eslint/angular-eslint@v13.0.0...v13.0.1) (2021-11-19) ##### Bug Fixes - **schematics:** auto update eslint-plugin-import as part of v13 ng update ([#​836](angular-eslint/angular-eslint#836)) ([705e83b](angular-eslint/angular-eslint@705e83b)) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/template-parser)</summary> ### [`v13.1.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/template-parser/CHANGELOG.md#​1310-httpsgithubcomangular-eslintangular-eslintcomparev1301v1310-2022-02-13) [Compare Source](angular-eslint/angular-eslint@v13.0.1...v13.1.0) **Note:** Version bump only for package [@​angular-eslint/template-parser](https://github.com/angular-eslint/template-parser) #### [13.0.1](angular-eslint/angular-eslint@v13.0.0...v13.0.1) (2021-11-19) **Note:** Version bump only for package [@​angular-eslint/template-parser](https://github.com/angular-eslint/template-parser) </details> --- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1172 Reviewed-by: Epsilon_02 <epsilon_02@noreply.codeberg.org> Co-authored-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org> Co-committed-by: Calciumdibromid Bot <cabr2_bot@noreply.codeberg.org>
Closes #891.
Note, I attempted to include a test case for this specific issue, but the returned location info was always out of alignment with the annotated test case location, I believe because my test case always contained a template compilation issue.