Replies: 1 comment 3 replies
-
useLiteralKeys will report this pattern. Do you think we really need a specific rule here? If we add this rule, I think we should still allow computed key that are not identifiers such as |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I haven't found any rule like that when I searched for it briefly, so this might be new rule.
Disallow dynamic access of namespaced imports. For example we use ParaglideJS and it export its i18n keys like this:
Under the hood each key is separate file, so Rollup is able to tree shake them, however if we use it as dynamic map:
The whole object must be inlined and bundle size would explode.
In this more contrived example, people might pull whole react lib instead of one hook:
So I would propose adding new lint rule, which disallows dynamic access on namespaced imports, this would be less restrictive version of https://biomejs.dev/linter/rules/no-namespace-import/
Beta Was this translation helpful? Give feedback.
All reactions