Skip to content

Commit af1c1bd

Browse files
committed
feat(linter/unicorn): implement prefer-at
1 parent 46cceb8 commit af1c1bd

File tree

4 files changed

+1342
-0
lines changed

4 files changed

+1342
-0
lines changed

crates/oxc_linter/src/generated/rule_runner_impls.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,6 +2609,14 @@ impl RuleRunner for crate::rules::unicorn::prefer_array_some::PreferArraySome {
26092609
Some(&AstTypesBitset::from_types(&[AstType::BinaryExpression, AstType::CallExpression]));
26102610
}
26112611

2612+
impl RuleRunner for crate::rules::unicorn::prefer_at::PreferAt {
2613+
const NODE_TYPES: Option<&AstTypesBitset> = Some(&AstTypesBitset::from_types(&[
2614+
AstType::CallExpression,
2615+
AstType::ChainExpression,
2616+
AstType::ComputedMemberExpression,
2617+
]));
2618+
}
2619+
26122620
impl RuleRunner for crate::rules::unicorn::prefer_blob_reading_methods::PreferBlobReadingMethods {
26132621
const NODE_TYPES: Option<&AstTypesBitset> =
26142622
Some(&AstTypesBitset::from_types(&[AstType::CallExpression]));

crates/oxc_linter/src/rules.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ pub(crate) mod unicorn {
451451
pub mod prefer_array_flat_map;
452452
pub mod prefer_array_index_of;
453453
pub mod prefer_array_some;
454+
pub mod prefer_at;
454455
pub mod prefer_blob_reading_methods;
455456
pub mod prefer_code_point;
456457
pub mod prefer_date_now;
@@ -1174,6 +1175,7 @@ oxc_macros::declare_all_lint_rules! {
11741175
unicorn::no_zero_fractions,
11751176
unicorn::number_literal_case,
11761177
unicorn::numeric_separators_style,
1178+
unicorn::prefer_at,
11771179
unicorn::prefer_global_this,
11781180
unicorn::prefer_object_from_entries,
11791181
unicorn::prefer_array_find,

0 commit comments

Comments
 (0)