biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.

Home Page:https://biomejs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸ“Ž Implement noDynamicNamespaceImportAccess

minht11 opened this issue Β· comments

Description

Implement rule discussed in #3164
Biome already has noNamespaceImport but that rule is likely too restrictive for general use. Instead this new rule proposes disallowing only dynamic access on namespaced imports, because if bundler can't determine what import to use at compile time it must include whole namespace, potentially increasing bundle size by a lot.

import * as m from './messages'
const dynamicKey = 'key'
m[key] // whole messages namespace must be included.

As far as I know this is unique rule.