Skip to content

no-units-spawn-in-render#180

Merged
AlexandrHoroshih merged 5 commits into
masterfrom
next-release-april-2026
Apr 10, 2026
Merged

no-units-spawn-in-render#180
AlexandrHoroshih merged 5 commits into
masterfrom
next-release-april-2026

Conversation

@AlexandrHoroshih
Copy link
Copy Markdown
Member

No description provided.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 9, 2026

Deploy Preview for eslint-plugin ready!

Name Link
🔨 Latest commit c6ca014
🔍 Latest deploy log https://app.netlify.com/projects/eslint-plugin/deploys/69d895a51015a50008064881
😎 Deploy Preview https://deploy-preview-180--eslint-plugin.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@AlexandrHoroshih AlexandrHoroshih changed the title Implement no-units-spawn-in-render Next Release Apr 9, 2026
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment on lines +176 to +182
function getCalleeName(callee: Node.CallExpression["callee"]): string | null {
if (callee.type === AST_NODE_TYPES.Identifier) return callee.name
if (callee.type === AST_NODE_TYPES.MemberExpression && callee.property.type === AST_NODE_TYPES.Identifier) {
return callee.property.name
}
return null
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These checks for AST_NODE_TYPES are duplicated across the rule implementation, so it might be beneficial to

  1. Either narrow this down on a esquery selector level to remove unrelated work altogether, or
  2. Expand the logic to both check and format the name for a more nested structure (there's no reason to exclude a.b.c() while including a.b())

p.s. This might also help make these names prettier by including full path. Currently domain.event() produces just event in an error, but it might be nice to have domain.event.

Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.test.ts Outdated
@AlexandrHoroshih AlexandrHoroshih force-pushed the next-release-april-2026 branch from adf99f3 to 0f85d3b Compare April 9, 2026 12:41
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts Outdated
Comment thread src/rules/no-units-spawn-in-render/no-units-spawn-in-render.ts
// `useContext` is excluded because it legitimately retrieves pre-created units.
// - Namespaced effector calls (e.g. `effector.createStore`) are matched
// by callee type against the effector package
// - Anything remaining is treated as a custom factory
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for future: this directly conflicts with third-party "model" providers, like effector-factorio with its factory.useModel(). Do we recommend disabling the rule for these users, or do we make the rule configurable?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call

I think, we may add an exception ahead of time for that

@AlexandrHoroshih AlexandrHoroshih merged commit 498b274 into master Apr 10, 2026
8 checks passed
@AlexandrHoroshih AlexandrHoroshih deleted the next-release-april-2026 branch April 10, 2026 07:40
@AlexandrHoroshih AlexandrHoroshih changed the title Next Release no-units-spawn-in-render Apr 13, 2026
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.

2 participants