mobx icon indicating copy to clipboard operation
mobx copied to clipboard

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

Open kade-robertson opened this issue 1 year ago • 1 comments

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

  • [x] Added/updated unit tests -- No unit testing in the eslint package, but I have tested these changes against some other projects that use this rule.
  • [x] Updated /docs. For new functionality, at least API.md should be updated
  • [x] Verified that there is no significant performance drop (yarn mobx test:performance)

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

kade-robertson avatar May 21 '24 13:05 kade-robertson

🦋 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

changeset-bot[bot] avatar May 21 '24 13:05 changeset-bot[bot]

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.

urugator avatar May 25 '24 12:05 urugator

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 avatar May 25 '24 17:05 kade-robertson

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

kade-robertson avatar May 25 '24 17:05 kade-robertson

With additional changes LGTM, thanks for adding this!

mweststrate avatar May 29 '24 19:05 mweststrate