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

πŸ“Ž Change `bit_flags` for `enumflags2`

ematipico opened this issue Β· comments

Description

Inside the biome_js_analyze, we started using enumflags2, and the DX has been positive.

This is a task to remove bit_flags from the codebase, and use enumflags2. This is an example of definition:

#[enumflags2::bitflags]
#[repr(u16)]
pub enum Modifier {
// modifiers must be sorted by precedence.
Decorator = 1 << 0,
BogusAccessibility = 1 << 1,
Private = 1 << 2,
Protected = 1 << 3,
Public = 1 << 4,
Declare = 1 << 5,
Static = 1 << 6,
Abstract = 1 << 7,
Override = 1 << 8,
Readonly = 1 << 9,
Accessor = 1 << 10,
}

Feel free to send multiple PRs to address this, we use bit_flags in different places of the repository.