Skip to content

Commit

Permalink
chore(linter): only check no-this-alias in TypeScript
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jul 29, 2023
1 parent 92348f1 commit 4b34c44
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/oxc_linter/src/rules/typescript/no_this_alias.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ impl Rule for NoThisAlias {
}

fn run<'a>(&self, node: &AstNode<'a>, ctx: &LintContext<'a>) {
if !ctx.source_type().is_typescript() {
return;
}
match node.kind() {
AstKind::VariableDeclarator(decl) => {
let Some(init) = &decl.init else { return };
Expand Down

0 comments on commit 4b34c44

Please sign in to comment.