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(eslint-plugin-template): [no-duplicate-attributes] Add option to ignore properties #1104
feat(eslint-plugin-template): [no-duplicate-attributes] Add option to ignore properties #1104
Conversation
… ignore properties
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 27eb768. As they complete they will appear below. 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. |
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.
Thank you @ssams. I'm not super familiar with the behaviour of the framework in the example you give, but adding this option is low effort and low risk so let's press ahead with it.
Please remove the different data types for ignore
, an array of strings is all that is needed and simplifies both the usage and implementation
ok, I've changed the type to an array as requested |
Thanks a lot @ssams - we just need to regenerate the docs now that the options have changed. You just need to run |
done :-) |
Codecov Report
@@ Coverage Diff @@
## main #1104 +/- ##
=======================================
Coverage 87.69% 87.70%
=======================================
Files 157 157
Lines 2959 2961 +2
Branches 475 476 +1
=======================================
+ Hits 2595 2597 +2
Misses 253 253
Partials 111 111
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Thanks a lot @ssams!
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular-eslint/builder](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`14.1.2` -> `14.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2fbuilder/14.1.2/14.2.0) | | [@angular-eslint/eslint-plugin](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`14.1.2` -> `14.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2feslint-plugin/14.1.2/14.2.0) | | [@angular-eslint/eslint-plugin-template](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`14.1.2` -> `14.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2feslint-plugin-template/14.1.2/14.2.0) | | [@angular-eslint/schematics](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`14.1.2` -> `14.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2fschematics/14.1.2/14.2.0) | | [@angular-eslint/template-parser](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`14.1.2` -> `14.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2ftemplate-parser/14.1.2/14.2.0) | --- ### Release Notes <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/builder)</summary> ### [`v14.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/builder/CHANGELOG.md#​1420-httpsgithubcomangular-eslintangular-eslintcomparev1412v1420-2022-11-15) [Compare Source](angular-eslint/angular-eslint@v14.1.2...v14.2.0) **Note:** Version bump only for package [@​angular-eslint/builder](https://github.com/angular-eslint/builder) #### [14.1.2](angular-eslint/angular-eslint@v14.1.1...v14.1.2) (2022-09-21) ##### Bug Fixes - **builder:** remove nrwl/devkit from builder implementation ([#​1142](angular-eslint/angular-eslint#1142)) ([9d5a7fc](angular-eslint/angular-eslint@9d5a7fc)) #### [14.1.1](angular-eslint/angular-eslint@v14.1.0...v14.1.1) (2022-09-18) **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> ### [`v14.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#​1420-httpsgithubcomangular-eslintangular-eslintcomparev1412v1420-2022-11-15) [Compare Source](angular-eslint/angular-eslint@v14.1.2...v14.2.0) ##### Bug Fixes - update typescript-eslint packages to v5.38.1 ([#​1152](angular-eslint/angular-eslint#1152)) ([8f6d0ef](angular-eslint/angular-eslint@8f6d0ef)) - update typescript-eslint packages to v5.43.0 ([#​1190](angular-eslint/angular-eslint#1190)) ([2a4716a](angular-eslint/angular-eslint@2a4716a)) ##### Features - update typescript-eslint packages to v5.38.0 ([#​1140](angular-eslint/angular-eslint#1140)) ([85b4b47](angular-eslint/angular-eslint@85b4b47)) #### [14.1.2](angular-eslint/angular-eslint@v14.1.1...v14.1.2) (2022-09-21) **Note:** Version bump only for package [@​angular-eslint/eslint-plugin](https://github.com/angular-eslint/eslint-plugin) #### [14.1.1](angular-eslint/angular-eslint@v14.1.0...v14.1.1) (2022-09-18) ##### Bug Fixes - **eslint-plugin:** \[sort-ngmodule-metadata-arrays]: add intl support ([#​1099](angular-eslint/angular-eslint#1099)) ([30d133b](angular-eslint/angular-eslint@30d133b)) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/eslint-plugin-template)</summary> ### [`v14.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/eslint-plugin-template/CHANGELOG.md#​1420-httpsgithubcomangular-eslintangular-eslintcomparev1412v1420-2022-11-15) [Compare Source](angular-eslint/angular-eslint@v14.1.2...v14.2.0) ##### Bug Fixes - update dependency aria-query to v5.1.3 ([#​1183](angular-eslint/angular-eslint#1183)) ([7c5b299](angular-eslint/angular-eslint@7c5b299)) - update dependency axobject-query to v3.1.1 ([#​1184](angular-eslint/angular-eslint#1184)) ([dcfd43d](angular-eslint/angular-eslint@dcfd43d)) - update typescript-eslint packages to v5.38.1 ([#​1152](angular-eslint/angular-eslint#1152)) ([8f6d0ef](angular-eslint/angular-eslint@8f6d0ef)) - update typescript-eslint packages to v5.43.0 ([#​1190](angular-eslint/angular-eslint#1190)) ([2a4716a](angular-eslint/angular-eslint@2a4716a)) ##### Features - **eslint-plugin-template:** \[accessibility-interactive-supports-focus] add rule ([#​1134](angular-eslint/angular-eslint#1134)) ([d99d8c1](angular-eslint/angular-eslint@d99d8c1)) - **eslint-plugin-template:** \[accessibility-role-has-required-aria] add rule ([#​1100](angular-eslint/angular-eslint#1100)) ([f684df0](angular-eslint/angular-eslint@f684df0)) - **eslint-plugin-template:** \[attributes-order] add rule with fixer ([#​1066](angular-eslint/angular-eslint#1066)) ([4c789c7](angular-eslint/angular-eslint@4c789c7)) - **eslint-plugin-template:** \[no-duplicate-attributes] Add option to ignore properties ([#​1104](angular-eslint/angular-eslint#1104)) ([018d390](angular-eslint/angular-eslint@018d390)) - update typescript-eslint packages to v5.38.0 ([#​1140](angular-eslint/angular-eslint#1140)) ([85b4b47](angular-eslint/angular-eslint@85b4b47)) #### [14.1.2](angular-eslint/angular-eslint@v14.1.1...v14.1.2) (2022-09-21) **Note:** Version bump only for package [@​angular-eslint/eslint-plugin-template](https://github.com/angular-eslint/eslint-plugin-template) #### [14.1.1](angular-eslint/angular-eslint@v14.1.0...v14.1.1) (2022-09-18) ##### Bug Fixes - **eslint-plugin-template:** \[click-events-have-key-events]: handle additional outputs ([#​1101](angular-eslint/angular-eslint#1101)) ([c608cdb](angular-eslint/angular-eslint@c608cdb)) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/schematics)</summary> ### [`v14.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/schematics/CHANGELOG.md#​1420-httpsgithubcomangular-eslintangular-eslintcomparev1412v1420-2022-11-15) [Compare Source](angular-eslint/angular-eslint@v14.1.2...v14.2.0) ##### Bug Fixes - update dependency eslint to v8.27.0 ([#​1189](angular-eslint/angular-eslint#1189)) ([d2ae95a](angular-eslint/angular-eslint@d2ae95a)) - update typescript-eslint packages to v5.38.1 ([#​1152](angular-eslint/angular-eslint#1152)) ([8f6d0ef](angular-eslint/angular-eslint@8f6d0ef)) - update typescript-eslint packages to v5.43.0 ([#​1190](angular-eslint/angular-eslint#1190)) ([2a4716a](angular-eslint/angular-eslint@2a4716a)) ##### Features - update dependency eslint to v8.24.0 ([#​1148](angular-eslint/angular-eslint#1148)) ([5f30b2d](angular-eslint/angular-eslint@5f30b2d)) - update typescript-eslint packages to v5.38.0 ([#​1140](angular-eslint/angular-eslint#1140)) ([85b4b47](angular-eslint/angular-eslint@85b4b47)) #### [14.1.2](angular-eslint/angular-eslint@v14.1.1...v14.1.2) (2022-09-21) **Note:** Version bump only for package [@​angular-eslint/schematics](https://github.com/angular-eslint/schematics) #### [14.1.1](angular-eslint/angular-eslint@v14.1.0...v14.1.1) (2022-09-18) **Note:** Version bump only for package [@​angular-eslint/schematics](https://github.com/angular-eslint/schematics) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/template-parser)</summary> ### [`v14.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/template-parser/CHANGELOG.md#​1420-httpsgithubcomangular-eslintangular-eslintcomparev1412v1420-2022-11-15) [Compare Source](angular-eslint/angular-eslint@v14.1.2...v14.2.0) ##### Bug Fixes - update dependency eslint-scope to v7 ([#​1156](angular-eslint/angular-eslint#1156)) ([05bd9e6](angular-eslint/angular-eslint@05bd9e6)) #### [14.1.2](angular-eslint/angular-eslint@v14.1.1...v14.1.2) (2022-09-21) **Note:** Version bump only for package [@​angular-eslint/template-parser](https://github.com/angular-eslint/template-parser) #### [14.1.1](angular-eslint/angular-eslint@v14.1.0...v14.1.1) (2022-09-18) **Note:** Version bump only for package [@​angular-eslint/template-parser](https://github.com/angular-eslint/template-parser) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - 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, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4xIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMSJ9--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1641 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>
This introduces a new option
ignore
on the@angular-eslint/template/no-duplicate-attributes
rule to ignore reports from selected duplicate attributes.Rationale
In some special cases presence of duplicate attributes may be required, this allows to keep the rule enabled whilst being capable of not generating errors/warnings on accepted duplicates.
For example, in our project we regularly need to apply both a static text attribute
class="foo"
together with a bound[class]=dynamicValue
. In our project this is necessary to ensure the static class is always present, also including it in the dynamic property handled via thengClass
would cause it to appear only after all inputs have been updated, which in some cases can cause visual flickering due to the toggling of the class by the directive. Hence we need to be able to ignore reports on theclass
attribute, but want to keep using the rule for others.