Skip to content

Commit 6e1e4a1

Browse files
committed
feat(linter): add unicorn/prefer-keyboard-event-key rule
1 parent 913b1b3 commit 6e1e4a1

File tree

4 files changed

+1656
-0
lines changed

4 files changed

+1656
-0
lines changed

crates/oxc_linter/src/generated/rule_runner_impls.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,6 +3589,11 @@ impl RuleRunner for crate::rules::unicorn::prefer_includes::PreferIncludes {
35893589
const RUN_FUNCTIONS: RuleRunFunctionsImplemented = RuleRunFunctionsImplemented::Run;
35903590
}
35913591

3592+
impl RuleRunner for crate::rules::unicorn::prefer_keyboard_event_key::PreferKeyboardEventKey {
3593+
const NODE_TYPES: Option<&AstTypesBitset> = None;
3594+
const RUN_FUNCTIONS: RuleRunFunctionsImplemented = RuleRunFunctionsImplemented::Run;
3595+
}
3596+
35923597
impl RuleRunner for crate::rules::unicorn::prefer_logical_operator_over_ternary::PreferLogicalOperatorOverTernary {
35933598
const NODE_TYPES: Option<&AstTypesBitset> = Some(&AstTypesBitset::from_types(&[AstType::ConditionalExpression]));
35943599
const RUN_FUNCTIONS: RuleRunFunctionsImplemented = RuleRunFunctionsImplemented::Run;

crates/oxc_linter/src/rules.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ pub(crate) mod unicorn {
479479
pub mod prefer_event_target;
480480
pub mod prefer_global_this;
481481
pub mod prefer_includes;
482+
pub mod prefer_keyboard_event_key;
482483
pub mod prefer_logical_operator_over_ternary;
483484
pub mod prefer_math_min_max;
484485
pub mod prefer_math_trunc;
@@ -1221,6 +1222,7 @@ oxc_macros::declare_all_lint_rules! {
12211222
unicorn::prefer_classlist_toggle,
12221223
unicorn::prefer_class_fields,
12231224
unicorn::prefer_bigint_literals,
1225+
unicorn::prefer_keyboard_event_key,
12241226
unicorn::prefer_response_static_json,
12251227
unicorn::prefer_top_level_await,
12261228
unicorn::prefer_at,

0 commit comments

Comments
 (0)