Skip to content

build: ngOnChanges property access rule not working - #21075

Merged
annieyw merged 1 commit into
angular:masterfrom
crisbeto:property-access-rule-failures
Nov 24, 2020
Merged

build: ngOnChanges property access rule not working#21075
annieyw merged 1 commit into
angular:masterfrom
crisbeto:property-access-rule-failures

Conversation

@crisbeto

Copy link
Copy Markdown
Member

Follow-up to #21074. We have a lint rule that flags property accesses like changes.foo where changes is a SimpleChanges object, because they'll break under Closure compiler. The rule depends on the TS type checker to identify the objects, but it seems like somewhere along the way, tslint changed how they construct the Program which removed the necessary type information.

These changes add a less complicated fallback which looks at whether the name of the receiver of a property access is the same as the name of the first method parameter.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround blocked This issue is blocked by some external factor, such as a prerequisite PR merge safe target: patch This PR is targeted for the next patch release labels Nov 18, 2020
@crisbeto
crisbeto requested a review from a team November 18, 2020 07:53
@google-cla google-cla Bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 18, 2020
@crisbeto

Copy link
Copy Markdown
Member Author

Blocked on #21074.

@crisbeto
crisbeto force-pushed the property-access-rule-failures branch from a5e042b to 66b6934 Compare November 18, 2020 14:44
@crisbeto crisbeto removed the blocked This issue is blocked by some external factor, such as a prerequisite PR label Nov 18, 2020
@crisbeto

Copy link
Copy Markdown
Member Author

No longer blocked.

@mmalerba mmalerba left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Nov 19, 2020
@wagnermaciel

Copy link
Copy Markdown
Contributor

@crisbeto Can you force push to try and force CI to run? Something weird happened here and it's not running.

Follow-up to angular#21074. We have a lint rule that flags property accesses like `changes.foo`
where `changes` is a `SimpleChanges` object, because they'll break under Closure
compiler. The rule depends on the TS type checker to identify the objects, but it
seems like somewhere along the way, tslint changed how they construct the
`Program` which removed the necessary type information.

These changes add a less complicated fallback which looks at whether the name
of the receiver of a property access is the same as the name of the first method
parameter.
@crisbeto
crisbeto force-pushed the property-access-rule-failures branch from 66b6934 to 6348b6c Compare November 20, 2020 19:42
@crisbeto

Copy link
Copy Markdown
Member Author

Done. Also rebased.

@annieyw
annieyw merged commit 2465131 into angular:master Nov 24, 2020
annieyw pushed a commit that referenced this pull request Nov 24, 2020
Follow-up to #21074. We have a lint rule that flags property accesses like `changes.foo`
where `changes` is a `SimpleChanges` object, because they'll break under Closure
compiler. The rule depends on the TS type checker to identify the objects, but it
seems like somewhere along the way, tslint changed how they construct the
`Program` which removed the necessary type information.

These changes add a less complicated fallback which looks at whether the name
of the receiver of a property access is the same as the name of the first method
parameter.

(cherry picked from commit 2465131)
@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants