Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(lint/useSimpleNumberKeys): ignore comments #957

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ Read our [guidelines for writing a good changelog entry](https://github.com/biom

#### Bug fixes

- Fix [#918](https://github.com/biomejs/biome/issues/918), [useSimpleNumberKeys](https://biomejs.dev/linter/rules/use-simple-number-keys) no longer repports false positive on comments. Contributed by @kalleep

### Parser

## 1.4.0 (2023-11-27)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::JsRuleAction;

use biome_analyze::{
context::RuleContext, declare_rule, ActionCategory, Ast, FixKind, Rule, RuleDiagnostic,
};
Expand Down Expand Up @@ -101,7 +102,7 @@ impl TryFrom<AnyJsObjectMember> for NumberLiteral {
let token = literal_member_name.value().unwrap();
match token.kind() {
JsSyntaxKind::JS_NUMBER_LITERAL | JsSyntaxKind::JS_BIGINT_LITERAL => {
let chars: Vec<char> = token.to_string().chars().collect();
let chars: Vec<char> = token.text_trimmed().chars().collect();
let mut value = String::new();

let mut is_first_char_zero: bool = false;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
({ 1n: 1 });
({ 0x1: 1 });
({
0x1: 1
});
({ 0o12: 1 });
({ 0b1: 1 });
({ 0o1: 1 });
Expand Down
Loading