Skip to content
This repository has been archived by the owner on Jul 11, 2024. It is now read-only.

Rules migration status #15

Closed
jsaguet opened this issue May 27, 2020 · 19 comments
Closed

Rules migration status #15

jsaguet opened this issue May 27, 2020 · 19 comments

Comments

@jsaguet
Copy link
Collaborator

jsaguet commented May 27, 2020

I wanted to create this issue to follow-up the rules migration from ngrx-tslint-rules.
This could also be useful integrated as documentation for new users or if we want to implement a migration schematic in the end (in this repo or in @angular-eslint)

The following table gives the tslint rule name, the corresponding eslint rule name and the status

TSLint Rule ESLint Rule Status
ngrx-action-hygiene ngrx/action-hygiene ✔️ Done
ngrx-avoid-dispatching-multiple-actions-sequentially ngrx/avoid-dispatching-multiple-actions-sequentially ✔️ Done
ngrx-effect-creator-and-decorator ngrx/no-effect-decorator-and-creator ✔️ Done
ngrx-no-dispatch-in-effects ngrx/no-dispatch-in-effects ✔️ Done
ngrx-no-duplicate-action-types - Managed by strictActionTypeUniqueness runtime check in NGRX >= 9.2.0
See ngrx/platform#2520
ngrx-no-effect-decorator ngrx/no-effect-decorator ✔️ Done
ngrx-no-effects-in-providers ngrx/no-effects-in-providers ✔️ Done
ngrx-no-multiple-actions-in-effects ngrx/no-multiple-actions-in-effects ✔️ Done
ngrx-no-multiple-stores ngrx/no-multiple-stores ✔️ Done
ngrx-no-reducer-in-key-names ngrx/no-reducer-in-key-names ✔️ Done
ngrx-no-typed-store ngrx/no-typed-store ✔️ Done
ngrx-selector-for-select ngrx/use-selector-in-select ✔️ Done
ngrx-on-reducer-explicit-return-type ngrx/on-function-explicit-return-type ✔️ Done
@jsaguet jsaguet changed the title Rule migration status Rules migration status May 27, 2020
@timdeschryver
Copy link
Owner

timdeschryver commented May 27, 2020

Awesome, ngrx-no-duplicate-action-types is indeed not needed.
It would also be hard to do with eslint I think, as it looks across files.

no-duplicate-action-in-reducer should be removed - this is now supported in NgRx.

@jsaguet
Copy link
Collaborator Author

jsaguet commented May 27, 2020

Awesome, ngrx-no-duplicate-action-types is indeed not needed.
It would also be hard to do with eslint I think, as it looks across files.

👍

no-duplicate-action-in-reducer should be removed - this is now supported in NgRx.

It seems it does not work when you're exporting actions in an object. (which is usually my case)

@timdeschryver
Copy link
Owner

Do you got some code to share, and what's the NgRx version you're on?

@jsaguet
Copy link
Collaborator Author

jsaguet commented May 28, 2020

I created a repository.
I don't see any error from ngrx of duplicate actions either when using directly the action in the reducer or actions in an object.
Do I need to enable something to see it? Is it reported at build type or directly in the editor?

@timdeschryver
Copy link
Owner

timdeschryver commented May 28, 2020

That's now become valid in NgRx.
It will invoke all reducer actions, if you add the same action twice, both will be invoked. (in the same order that they're added to the reducer)

@jsaguet
Copy link
Collaborator Author

jsaguet commented May 28, 2020

OK so the rule should be removed because it is valid ? I understood that it should be removed because the error was displayed by ngrx

@timdeschryver
Copy link
Owner

Exactly @jsaguet it's now valid.

@timdeschryver
Copy link
Owner

timdeschryver commented May 29, 2020

We can add timdeschryver/ngrx-tslint-rules#36 to the list when it gets merged :)

@jsaguet
Copy link
Collaborator Author

jsaguet commented May 29, 2020

Rule was added to the list.
I also updated the message to talk about strictActionTypeUniqueness runtime check

@timdeschryver
Copy link
Owner

@all-contributors please add @jsaguet for ideas

@timdeschryver
Copy link
Owner

@all-contributors please add @StephenCooper for ideas

@allcontributors
Copy link
Contributor

@timdeschryver

I've put up a pull request to add @jsaguet! 🎉

@allcontributors
Copy link
Contributor

@timdeschryver

I've put up a pull request to add @StephenCooper! 🎉

@timdeschryver
Copy link
Owner

timdeschryver commented May 31, 2020

Thanks for your work on this @jsaguet , what do you think about becoming a collaborator 😁?

@jsaguet
Copy link
Collaborator Author

jsaguet commented May 31, 2020

I'd be glad to continue helping you out on this project however I can! 🙂

@timdeschryver
Copy link
Owner

timdeschryver commented Jun 1, 2020

Putting a fix for ngrx/on-function-explicit-return-type in the tslint package here, so we won't forget about it.

timdeschryver/ngrx-tslint-rules#37

Update: we already had this covered 🎉 - I made an extra test to verify it tho (#26)

@timdeschryver
Copy link
Owner

I think this issue can be closed 🎉

@jsaguet
Copy link
Collaborator Author

jsaguet commented Jun 12, 2020

Yes, I guess now it's time to write a bit of documentation 😄

@timdeschryver
Copy link
Owner

Awesome, thanks again @jsaguet !

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants