mobxjs / mobx

Simple, scalable state management.
http://mobx.js.org
MIT License
27.56k stars 1.78k forks source link

feat(eslint-plugin-mobx): configurable default autofix annotation for makeObservable #3881

Closed kade-robertson closed 5 months ago

kade-robertson commented 6 months ago

Adds an option for the mobx/exhaustive-make-observable eslint rule to configure whether fields are annotated with true or false with the autofixer.

This option defaults to true if not present or an invalid value is received to maintain existing behavior.

Code change checklist

Note: It looks like some formatting rules have changed since the last time this file was touched so there's quite a lot of changes.

Closes #3876

changeset-bot[bot] commented 6 months ago

🦋 Changeset detected

Latest commit: 074c373cee0bc4246276604c204b9e0f5cae800a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------ | ----- | | eslint-plugin-mobx | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

urugator commented 5 months ago

Would you mind creating a PR that just runs prettier so we would merge it first? If not, it's completely fine, just pinpoint me to the changed lines, I assume it should be just 9, 80, 85.

kade-robertson commented 5 months ago

Would you mind creating a PR that just runs prettier so we would merge it first? If not, it's completely fine, just pinpoint me to the changed lines, I assume it should be just 9, 80, 85.

I can do that -- if it needs to be applied to the whole project though it looks like about 35 files are going to be changed. For now I'll push some commits in a bit that separate out the initial prettier write step and the changes I made to make it more obvious.

kade-robertson commented 5 months ago

See https://github.com/mobxjs/mobx/pull/3881/commits/1e99618c2cb42e5238a38a11f157038e2ec56af5 for the extent of actual changes.

mweststrate commented 5 months ago

With additional changes LGTM, thanks for adding this!