-
Notifications
You must be signed in to change notification settings - Fork 17
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
Rule: prefer-clean-model-structure
#114
Comments
the committee decided it was useless |
In my humble opinion, this rule can be useful in numerous instances. I suggest implementing in and waiting for community feedback. |
It looks like you missed one selction between (or I am missing )
stores subscribing on events/effect section should be there |
btw threre also could be spliing to exported/no-exported inside each section bad const firstEvent = createEvent();
export const firstExporedEvent = createEvent();
const secondEvent = createEvent();
export const secondExportedEvent = createEvent();
const store1 = createStore(0)
export const exportedStore1 = createStore(0)
const store2 = createStore(0)
export const exportedStore2 = createStore(0) good export const firstExporedEvent = createEvent();
export const secondExportedEvent = createEvent();
const firstEvent = createEvent();
const secondEvent = createEvent();
export const exportedStore1 = createStore(0)
export const exportedStore2 = createStore(0)
const store1 = createStore(0)
const store2 = createStore(0) |
In my view, export preferences does not relate to this rule, I suppose it's a lot ESLint rules to define where developers should write their exports. |
It is not about "where" write exports, but about how to sort regular unit definitions and exported definitions |
I still do not get it. How does it relate with Effector? We can use something like https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/group-exports.md for this purpose. I mean, it is a good idea not to mix exported and non-exported entities in any case, not only Effector-units. |
prefer-clean-model-structure
This rule should improve the readability of the code.
The rule should check the order of definitions of units:
attach
)sample
'sThis rule should ban using
.on
and.reset
etc. methods on stores immediately after definition. The same for domains, effects, and events.This rule should not be auto-fixable, because it's affects business-logic.
FAIL
OKAY
The text was updated successfully, but these errors were encountered: