biomejs / biome

A toolchain for web projects, aimed to provide functionalities to maintain them. Biome offers formatter and linter, usable via CLI and LSP.
https://biomejs.dev
Apache License 2.0
15.52k stars 482 forks source link

📎 Implement `noMagicNumbers` - `eslint/no-magic-numbers`, `typescript-eslint/no-magic-numbers` #4333

Open Conaclos opened 1 month ago

Conaclos commented 1 month ago

Description

Implement eslint/no-magic-numbers and typescript-eslint/no-magic-numbers.

Want to contribute? Lets you know you are interested! We will assign you to the issue to prevent several people to work on the same issue. Don't worry, we can unassign you later if you are no longer interested in the issue! Read our contributing guide and analyzer contributing guide.

See the related discussion for context.

The ESLint rule has many options. I suggest implementing a single option ignoreIntegers (See the Options section) for the time being.

Here are the exceptions we should bake in:

Options

We could introduce an ignoreIntegers option (turned off by default). When the option is set to true, all integers values are ignored:

1795;
1795n;
Conaclos commented 1 month ago

@fellipeutaka Could you add a comment on this task. I am not able to assign you to the task if you don't participate here.

fellipeutaka commented 1 month ago

@fellipeutaka Could you add a comment on this task. I am not able to assign you to the task if you don't participate here.

Oh, sorry. I'm ready to contribute to this task :)

Conaclos commented 1 month ago

Oh, sorry. I'm ready to contribute to this task :)

No problem. I was not aware of this limitation on GitHub ^^ I guess this is to avoid assigning a wrong person.