Skip to content
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

ESlint plugin #3097

Merged
merged 16 commits into from
Oct 22, 2021
Merged

ESlint plugin #3097

merged 16 commits into from
Oct 22, 2021

Conversation

urugator
Copy link
Collaborator

@urugator urugator commented Aug 29, 2021

Experimental and work in progress. Not completely commited to finish this. Not sure if there is an interest and enough use cases.

Looking for feedback, ideas, help (mainly with chore and setting up the project correctly)

exhaustive-make-observable
exhaustive-make-observable

missing-make-observable
missing-make-observable

unconditional-make-observable
eslint-sample-unconditional

@changeset-bot
Copy link

changeset-bot bot commented Aug 29, 2021

⚠️ No Changeset found

Latest commit: 3fda09c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@kubk
Copy link
Collaborator

kubk commented Aug 30, 2021

Hi @urugator I have a question regarding the first rule. Does it complain about all the class properties? I thought that the whole point of makeObservable is to have an option to intentionally skip some properties, e.g

class Store {
  o = 1;
  localStorageKey = 'some-key';
  
  constructor() {
    makeObservable(this, {
      o: observable,
      // Avoid marking localStorageKey because it's just a key for local storage
    })
  }
}

@urugator
Copy link
Collaborator Author

urugator commented Aug 30, 2021

@kubk The rule forces you to be explicit about this: { localStorageKey: false }.
Just to clarify, the auto-fix adds { prop: true } to annotations.

@urugator urugator marked this pull request as ready for review September 8, 2021 10:36
@mweststrate
Copy link
Member

This looks really awesome and super helpful! Looks to me pretty good to publish as-is, and we can iterate over it further with the community if needed.

@iChenLei
Copy link
Member

iChenLei commented Sep 16, 2021

I have a small issue, eslint-plugin-mobx has been registered on npmjs.org.

https://www.npmjs.com/package/eslint-plugin-mobx

Get in touch with the eslint-plugin-mobx's owner @chrisands to transfer package or release a new package(e.g @mobx/eslint-plugin) ?

cc @mweststrate @urugator , this is a small but important thing.

@iChenLei
Copy link
Member

@urugator I am sorry for click merge main branch, did it cause problems for your development?

@urugator
Copy link
Collaborator Author

I will merge this as is and create a new PR with changeset.

@urugator urugator merged commit 2426373 into mobxjs:main Oct 22, 2021
@urugator urugator deleted the eslint-plugin branch October 22, 2021 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants