Skip to content

build: enable strictFunctionTypes in schematics #23111

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

Merged

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Jul 5, 2021

Makes the schematics code compliant with the strictFunctionTypes compiler option.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent merge safe target: patch This PR is targeted for the next patch release labels Jul 5, 2021
@crisbeto crisbeto requested a review from devversion July 5, 2021 04:28
@crisbeto crisbeto requested a review from jelbourn as a code owner July 5, 2021 04:28
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 5, 2021
import * as ts from 'typescript';

/**
* Migration that checks for classes that extend Angular Material classes which
* have changed their API.
*/
export class MiscClassInheritanceMigration extends Migration<null> {
export class MiscClassInheritanceMigration extends DevkitMigration<null> {
Copy link
Member

Choose a reason for hiding this comment

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

Why have these been changed to a DevkitMigration? Is it due to the never/unknown change above for Migration, where they no longer are subtypes of DevkitMigration now? (this is what I wanted to achieve with never in the past).

The goal is to keep them decoupled from DevkitMigration so that these could technically be run within Google where they do not run within a devkit-based project.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, pretty much. I noticed that the DevkitMigration doesn't do all that much on top of the Migration so I decided to swap them out. If you think that it's not the correct approach, I can try something else.

Copy link
Member

Choose a reason for hiding this comment

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

It seems honestly unlikely at the current state that any of the migrations are needed in g3, but we put a lot of work initially into the infrastructure so that we can run them easily in g3 (without having to replicate logic w/ TSlint as in FW), so it would cool to see if we keep it like that, but if it's too much work then I personally don't mind a lot.

Copy link
Member Author

Choose a reason for hiding this comment

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

I pushed another change to default the Context to any instead of unknown.

Copy link
Member

Choose a reason for hiding this comment

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

👍 looks great!

Makes the schematics code compliant with the `strictFunctionTypes` compiler option.
@crisbeto crisbeto force-pushed the schematics-strict-function-types branch from e3ab2df to 6e17502 Compare July 5, 2021 19:03
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Jul 6, 2021
@wagnermaciel wagnermaciel merged commit 2628d27 into angular:master Jul 9, 2021
wagnermaciel pushed a commit that referenced this pull request Jul 9, 2021
Makes the schematics code compliant with the `strictFunctionTypes` compiler option.

(cherry picked from commit 2628d27)
@angular-automatic-lock-bot
Copy link

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 Aug 9, 2021
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 P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants