Skip to content

Commit 18304a6

Browse files
bartlomiejudsherret
authored andcommitted
refactor(lint): renames and code flattening (#27386)
Working on loading plugin configuration for #27203 I encountered a lot of complexity, so did some drive-by cleanups to make it easier to grok the code and have fewer duplicate names.
1 parent d7e93cf commit 18304a6

File tree

3 files changed

+259
-226
lines changed

3 files changed

+259
-226
lines changed

cli/args/mod.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use deno_config::workspace::WorkspaceLintConfig;
2424
use deno_config::workspace::WorkspaceResolver;
2525
use deno_core::resolve_url_or_path;
2626
use deno_graph::GraphKind;
27+
use deno_lint::linter::LintConfig as DenoLintConfig;
2728
use deno_npm::npm_rc::NpmRc;
2829
use deno_npm::npm_rc::ResolvedNpmRc;
2930
use deno_npm::resolution::ValidSerializedNpmResolutionSnapshot;
@@ -1351,9 +1352,7 @@ impl CliOptions {
13511352
Ok(result)
13521353
}
13531354

1354-
pub fn resolve_deno_lint_config(
1355-
&self,
1356-
) -> Result<deno_lint::linter::LintConfig, AnyError> {
1355+
pub fn resolve_deno_lint_config(&self) -> Result<DenoLintConfig, AnyError> {
13571356
let ts_config_result =
13581357
self.resolve_ts_config_for_emit(TsConfigType::Emit)?;
13591358

@@ -1362,7 +1361,7 @@ impl CliOptions {
13621361
ts_config_result.ts_config,
13631362
)?;
13641363

1365-
Ok(deno_lint::linter::LintConfig {
1364+
Ok(DenoLintConfig {
13661365
default_jsx_factory: (!transpile_options.jsx_automatic)
13671366
.then(|| transpile_options.jsx_factory.clone()),
13681367
default_jsx_fragment_factory: (!transpile_options.jsx_automatic)

cli/lsp/diagnostics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ use deno_graph::source::ResolveError;
4545
use deno_graph::Resolution;
4646
use deno_graph::ResolutionError;
4747
use deno_graph::SpecifierError;
48+
use deno_lint::linter::LintConfig as DenoLintConfig;
4849
use deno_resolver::sloppy_imports::SloppyImportsResolution;
4950
use deno_resolver::sloppy_imports::SloppyImportsResolutionKind;
5051
use deno_runtime::deno_fs;
@@ -834,7 +835,7 @@ fn generate_lint_diagnostics(
834835
lint_rule_provider.resolve_lint_rules(Default::default(), None)
835836
},
836837
fix: false,
837-
deno_lint_config: deno_lint::linter::LintConfig {
838+
deno_lint_config: DenoLintConfig {
838839
default_jsx_factory: None,
839840
default_jsx_fragment_factory: None,
840841
},

0 commit comments

Comments
 (0)