summaryrefslogtreecommitdiff
path: root/cli/tools/registry/diagnostics.rs
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2024-02-19 10:28:41 -0500
committerGitHub <noreply@github.com>2024-02-19 15:28:41 +0000
commit66424032a2c78c6010c0a1a1b22a26d081166660 (patch)
tree610e95beba5685ef1ba322375bf31a3fd6c5a187 /cli/tools/registry/diagnostics.rs
parent2b279ad630651e973d5a31586f58809f005bc925 (diff)
feat(unstable/lint): no-slow-types for JSR packages (#22430)
1. Renames zap/fast-check to instead be a `no-slow-types` lint rule. 1. This lint rule is automatically run when doing `deno lint` for packages (deno.json files with a name, version, and exports field) 1. This lint rules still occurs on publish. It can be skipped by running with `--no-slow-types`
Diffstat (limited to 'cli/tools/registry/diagnostics.rs')
-rw-r--r--cli/tools/registry/diagnostics.rs20
1 files changed, 13 insertions, 7 deletions
diff --git a/cli/tools/registry/diagnostics.rs b/cli/tools/registry/diagnostics.rs
index aeb5d61e2..b605c293b 100644
--- a/cli/tools/registry/diagnostics.rs
+++ b/cli/tools/registry/diagnostics.rs
@@ -30,7 +30,7 @@ pub struct PublishDiagnosticsCollector {
impl PublishDiagnosticsCollector {
pub fn print_and_error(&self) -> Result<(), AnyError> {
let mut errors = 0;
- let mut has_zap_errors = false;
+ let mut has_slow_types_errors = false;
let diagnostics = self.diagnostics.lock().unwrap().take();
for diagnostic in diagnostics {
eprint!("{}", diagnostic.display());
@@ -38,17 +38,23 @@ impl PublishDiagnosticsCollector {
errors += 1;
}
if matches!(diagnostic, PublishDiagnostic::FastCheck(..)) {
- has_zap_errors = true;
+ has_slow_types_errors = true;
}
}
if errors > 0 {
- if has_zap_errors {
+ if has_slow_types_errors {
eprintln!(
- "This package contains Zap errors. Although conforming to Zap will"
+ "This package contains errors for slow types. Fixing these errors will:\n"
);
- eprintln!("significantly improve the type checking performance of your library,");
- eprintln!("you can choose to skip it by providing the --no-zap flag.");
- eprintln!();
+ eprintln!(
+ " 1. Significantly improve your package users' type checking performance."
+ );
+ eprintln!(" 2. Improve the automatic documentation generation.");
+ eprintln!(" 3. Enable automatic .d.ts generation for Node.js.");
+ eprintln!(
+ "\nDon't want to bother? You can choose to skip this step by"
+ );
+ eprintln!("providing the --allow-slow-types flag.\n");
}
Err(anyhow!(