Skip to content

Commit

Permalink
chore(bench): include fixers in linter benchmarks (#5307)
Browse files Browse the repository at this point in the history
Fixing code is an important part of linter logic. We want to make sure fixers for each rule, and the code responsible for applying those fixes, are included in benchmarks.

As it currently stands, fixer closures are applied regardless of whether the user wants fixers to be applied. However, this is an implementation detail and is subject to change. I  also want to bench the performance of `Fixer`.
  • Loading branch information
DonIsaac committed Aug 28, 2024
1 parent 318479e commit 270fc53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/benchmark/benches/linter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{

use oxc_allocator::Allocator;
use oxc_benchmark::{criterion_group, criterion_main, BenchmarkId, Criterion};
use oxc_linter::{AllowWarnDeny, LintOptions, Linter};
use oxc_linter::{AllowWarnDeny, FixKind, LintOptions, Linter};
use oxc_parser::Parser;
use oxc_semantic::SemanticBuilder;
use oxc_span::SourceType;
Expand Down Expand Up @@ -43,6 +43,7 @@ fn bench_linter(criterion: &mut Criterion) {
];
let lint_options = LintOptions::default()
.with_filter(filter)
.with_fix(FixKind::All)
.with_import_plugin(true)
.with_jsdoc_plugin(true)
.with_jest_plugin(true)
Expand Down

0 comments on commit 270fc53

Please sign in to comment.