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(eslint-plugin): [no-inputs-metadata-property] do not report on di… #1248
fix(eslint-plugin): [no-inputs-metadata-property] do not report on di… #1248
Conversation
☁️ Nx Cloud ReportCI is running/has finished running commands for commit f524de2. 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. |
Codecov Report
@@ Coverage Diff @@
## main #1248 +/- ##
==========================================
- Coverage 88.11% 88.07% -0.05%
==========================================
Files 164 164
Lines 3172 3178 +6
Branches 512 515 +3
==========================================
+ Hits 2795 2799 +4
Misses 261 261
- Partials 116 118 +2
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.
Please could you add a comment around why we are doing this in a similar way to how I did with no-input-rename?
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.
Looks good to me! Some nitpicky comments and questions.
Oh and I just saw JamesHenry's comment after leaving mine.
ASTUtils.isProperty(ancestorMayBeHostDirectiveAPI) | ||
) { | ||
const hostDirectiveAPIPropertyName = 'hostDirectives'; | ||
|
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.
a short comment similar to https://github.com/angular-eslint/angular-eslint/pull/1231/files#diff-34e0047dec14410dccd7fee53b69b0edeb6c62c8b6d4480a4d6144e95aa323b5 might be useful.
@@ -45,6 +45,36 @@ export const valid = [ | |||
}) | |||
class Test {} | |||
`, | |||
` |
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.
a short commend similar to https://github.com/angular-eslint/angular-eslint/pull/1231/files#diff-1bbea1d57ed1e6d5683a8bc3bed3652cf91b699b8383932dac9422cf721f5bed might be useful.
@@ -29,6 +30,26 @@ export default createESLintRule<Options, MessageIds>({ | |||
} ${Selectors.metadataProperty(METADATA_PROPERTY_NAME)}`]( | |||
node: TSESTree.Property, | |||
) { | |||
const ancestorMayBeHostDirectiveAPI = node.parent?.parent?.parent; |
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.
question: I see a difference between the implementation here https://github.com/angular-eslint/angular-eslint/pull/1231/files#diff-34e0047dec14410dccd7fee53b69b0edeb6c62c8b6d4480a4d6144e95aa323b5. What's the reason for it?
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.
Only a slight difference 😄 . So in no-input-rename
, the targeted selector is Selectors.INPUTS_METADATA_PROPERTY_LITERAL
, while the targeted selector for this rule is ${Selectors.COMPONENT_OR_DIRECTIVE_CLASS_DECORATOR} ${Selectors.metadataProperty(METADATA_PROPERTY_NAME)}
. Although either of the two selectors could work for this rule, the main reason why I kept the latter selector is because when we do report a lint violation, we want to highlight the inputs
keyword like shown in the invalid test cases. When using the former selector, we'd end up highlighting the value bound to inputs
, which I think is less helpful.
2df8f8c
to
f77e79f
Compare
@JamesHenry ready for review. LMK what you think. |
…rective composition API
…the directive composition API
f77e79f
to
f524de2
Compare
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [@angular-eslint/builder](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`15.1.0` -> `15.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2fbuilder/15.1.0/15.2.0) | | [@angular-eslint/eslint-plugin](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`15.1.0` -> `15.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2feslint-plugin/15.1.0/15.2.0) | | [@angular-eslint/eslint-plugin-template](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`15.1.0` -> `15.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2feslint-plugin-template/15.1.0/15.2.0) | | [@angular-eslint/schematics](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`15.1.0` -> `15.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2fschematics/15.1.0/15.2.0) | | [@angular-eslint/template-parser](https://github.com/angular-eslint/angular-eslint) | devDependencies | minor | [`15.1.0` -> `15.2.0`](https://renovatebot.com/diffs/npm/@angular-eslint%2ftemplate-parser/15.1.0/15.2.0) | --- ### Release Notes <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/builder)</summary> ### [`v15.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/builder/CHANGELOG.md#​1520-httpsgithubcomangular-eslintangular-eslintcomparev1510v1520-2023-01-14) [Compare Source](angular-eslint/angular-eslint@v15.1.0...v15.2.0) **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> ### [`v15.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/eslint-plugin/CHANGELOG.md#​1520-httpsgithubcomangular-eslintangular-eslintcomparev1510v1520-2023-01-14) [Compare Source](angular-eslint/angular-eslint@v15.1.0...v15.2.0) ##### Bug Fixes - **eslint-plugin:** \[component-selector] enhance check for prefix and kebab-case ([#​1250](angular-eslint/angular-eslint#1250)) ([16827e4](angular-eslint/angular-eslint@16827e4)) - **eslint-plugin:** \[no-inputs-metadata-property] do not report on directive composition API ([#​1248](angular-eslint/angular-eslint#1248)) ([539cf9f](angular-eslint/angular-eslint@539cf9f)) - update typescript-eslint packages to v5.45.1 ([#​1239](angular-eslint/angular-eslint#1239)) ([abb7f79](angular-eslint/angular-eslint@abb7f79)) - update typescript-eslint packages to v5.48.1 ([#​1255](angular-eslint/angular-eslint#1255)) ([11151d1](angular-eslint/angular-eslint@11151d1)) ##### Features - **eslint-plugin:** \[require-localize-metadata] option to require meaning ([#​1235](angular-eslint/angular-eslint#1235)) ([b870123](angular-eslint/angular-eslint@b870123)) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/eslint-plugin-template)</summary> ### [`v15.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/eslint-plugin-template/CHANGELOG.md#​1520-httpsgithubcomangular-eslintangular-eslintcomparev1510v1520-2023-01-14) [Compare Source](angular-eslint/angular-eslint@v15.1.0...v15.2.0) ##### Bug Fixes - update typescript-eslint packages to v5.45.1 ([#​1239](angular-eslint/angular-eslint#1239)) ([abb7f79](angular-eslint/angular-eslint@abb7f79)) - update typescript-eslint packages to v5.48.1 ([#​1255](angular-eslint/angular-eslint#1255)) ([11151d1](angular-eslint/angular-eslint@11151d1)) ##### Features - **eslint-plugin-template:** \[i18n] option to require i18n metadata meaning ([#​1234](angular-eslint/angular-eslint#1234)) ([4ef0290](angular-eslint/angular-eslint@4ef0290)) - **eslint-plugin-template:** \[no-interpolation-in-attributes] new rule added ([#​1242](angular-eslint/angular-eslint#1242)) ([977cb3a](angular-eslint/angular-eslint@977cb3a)) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/schematics)</summary> ### [`v15.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/schematics/CHANGELOG.md#​1520-httpsgithubcomangular-eslintangular-eslintcomparev1510v1520-2023-01-14) [Compare Source](angular-eslint/angular-eslint@v15.1.0...v15.2.0) ##### Bug Fixes - update dependency eslint to v8.29.0 ([#​1246](angular-eslint/angular-eslint#1246)) ([10c14d2](angular-eslint/angular-eslint@10c14d2)) - update dependency eslint to v8.31.0 ([#​1262](angular-eslint/angular-eslint#1262)) ([db89c85](angular-eslint/angular-eslint@db89c85)) - update dependency ignore to v5.2.1 ([#​1237](angular-eslint/angular-eslint#1237)) ([609e06b](angular-eslint/angular-eslint@609e06b)) - update dependency ignore to v5.2.4 ([#​1263](angular-eslint/angular-eslint#1263)) ([a220e0c](angular-eslint/angular-eslint@a220e0c)) - update typescript-eslint packages to v5.45.1 ([#​1239](angular-eslint/angular-eslint#1239)) ([abb7f79](angular-eslint/angular-eslint@abb7f79)) - update typescript-eslint packages to v5.48.1 ([#​1255](angular-eslint/angular-eslint#1255)) ([11151d1](angular-eslint/angular-eslint@11151d1)) </details> <details> <summary>angular-eslint/angular-eslint (@​angular-eslint/template-parser)</summary> ### [`v15.2.0`](https://github.com/angular-eslint/angular-eslint/blob/HEAD/packages/template-parser/CHANGELOG.md#​1520-httpsgithubcomangular-eslintangular-eslintcomparev1510v1520-2023-01-14) [Compare Source](angular-eslint/angular-eslint@v15.1.0...v15.2.0) ##### Features - **eslint-plugin-template:** \[no-interpolation-in-attributes] new rule added ([#​1242](angular-eslint/angular-eslint#1242)) ([977cb3a](angular-eslint/angular-eslint@977cb3a)) </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:eyJjcmVhdGVkSW5WZXIiOiIzNC4xMDIuMCIsInVwZGF0ZWRJblZlciI6IjM0LjEwMi4wIn0=--> Co-authored-by: cabr2-bot <cabr2.help@gmail.com> Reviewed-on: https://codeberg.org/Calciumdibromid/CaBr2/pulls/1733 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>
…rective composition API
Resolve #1238