fix(unstable): move sloppy-import warnings to lint rule (#24710)

Adds a new `no-sloppy-imports` lint rule and cleans up the lint code.

Closes #22844
Closes https://github.com/denoland/deno_lint/issues/1293
This commit is contained in:
David Sherret 2024-07-25 09:07:59 -04:00 committed by GitHub
parent ef78d317f0
commit 763f05e74d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
63 changed files with 1601 additions and 955 deletions

View file

@ -750,8 +750,8 @@ fn enhanced_sloppy_imports_error_message(
ModuleError::LoadingErr(specifier, _, ModuleLoadError::Loader(_)) // ex. "Is a directory" error
| ModuleError::Missing(specifier, _) => {
let additional_message = SloppyImportsResolver::new(fs.clone())
.resolve(specifier, ResolutionMode::Execution)
.as_suggestion_message()?;
.resolve(specifier, ResolutionMode::Execution)?
.as_suggestion_message();
Some(format!(
"{} {} or run with --unstable-sloppy-imports",
error,