-
Notifications
You must be signed in to change notification settings - Fork 34
ESLint rule for user data lockfile #1430
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
base: f26d/lockfile-poc
Are you sure you want to change the base?
Conversation
src/storage/tests/user-data.test.ts
Outdated
@@ -7,7 +7,7 @@ import { normalize } from 'path'; | |||
import * as atomically from 'atomically'; | |||
import { getUserDataFilePath } from 'src/storage/paths'; | |||
import { UserData } from 'src/storage/storage-types'; | |||
import { loadUserData, saveUserData } from 'src/storage/user-data'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bcotrim I am reviewing, but initially wanted to say that here is something weird:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The general idea is awesome 👍
But I can't understand the usecase - in Frdrik's PR we are moving to using withUserDataWrite
as the wrapper for saveUserData
, so we won't use it directly anymore. And if somebody need to update appdata, they will definitely use only withUserDataWrite
as the single option which includes lock/unlock out of the box, so we don't need eslint for this approach.
Could you please elaborate on the idea, maybe I am missing something, but can't understand how this linter will be used with Fredrik's changes.
Thanks for the review @nightnei In Fredrik's PR you had some concerns about the readability and usage of the HOF, the ESLint rule allows us to not use that while ensuring we "force" developers to implement the lock/unlock in their code when they change the appdata. |
@bcotrim oh, I missed that it's a proposition of an alternative approach to HOF. The idea is really cool 👍 |
be5aa21
to
9a64b0b
Compare
Related issues
Proposed Changes
lock
andunlock
when making changes to the app data fileCode errors examples:
Testing Instructions
Pre-merge Checklist