From 4b06dc72ae7009892f1f55ea37cc5edabb511803 Mon Sep 17 00:00:00 2001 From: Dunqing <29533304+Dunqing@users.noreply.github.com> Date: Wed, 19 Jun 2024 16:00:57 +0000 Subject: [PATCH] feat(ast): add TSType::TSIntrinsicKeyword to is_keyword (#3775) follow up #3767 --- crates/oxc_ast/src/ast/ts.rs | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/crates/oxc_ast/src/ast/ts.rs b/crates/oxc_ast/src/ast/ts.rs index de260db30dcba..a8f0248d3b379 100644 --- a/crates/oxc_ast/src/ast/ts.rs +++ b/crates/oxc_ast/src/ast/ts.rs @@ -266,22 +266,13 @@ impl<'a> TSType<'a> { } } + #[rustfmt::skip] pub fn is_keyword(&self) -> bool { - matches!( - self, - TSType::TSAnyKeyword(_) - | TSType::TSBigIntKeyword(_) - | TSType::TSBooleanKeyword(_) - | TSType::TSNeverKeyword(_) - | TSType::TSNullKeyword(_) - | TSType::TSNumberKeyword(_) - | TSType::TSObjectKeyword(_) - | TSType::TSStringKeyword(_) - | TSType::TSSymbolKeyword(_) - | TSType::TSThisType(_) - | TSType::TSUndefinedKeyword(_) - | TSType::TSUnknownKeyword(_) - | TSType::TSVoidKeyword(_) + matches!(self, TSType::TSAnyKeyword(_) | TSType::TSBigIntKeyword(_) | TSType::TSBooleanKeyword(_) + | TSType::TSNeverKeyword(_) | TSType::TSNullKeyword(_) | TSType::TSNumberKeyword(_) + | TSType::TSObjectKeyword(_) | TSType::TSStringKeyword(_)| TSType::TSVoidKeyword(_) + | TSType::TSIntrinsicKeyword(_) | TSType::TSSymbolKeyword(_) | TSType::TSThisType(_) + | TSType::TSUndefinedKeyword(_) | TSType::TSUnknownKeyword(_) ) }