feat(config): preserve doc-style comments by default

Strip pass was eating JSDoc/Javadoc blocks. Add default preserve
patterns for /** blocks, /*! banners, /// and //! line docs.
Opt out by overriding preserve in .shush.toml.
This commit is contained in:
2026-07-08 13:24:29 -05:00
parent 272ce89ec5
commit 59c48a36cb
7 changed files with 80 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
/**
* Adds two numbers.
* @param {number} a
* @param {number} b
* @returns {number}
*/
function add(a, b) {
/*
* plain block comment
*/
return a + b; // plain line comment
}
/*! license banner */
/** single-line doc */
function noop() {}
+13
View File
@@ -0,0 +1,13 @@
/**
* Adds two numbers.
* @param {number} a
* @param {number} b
* @returns {number}
*/
function add(a, b) {
return a + b;
}
/*! license banner */
/** single-line doc */
function noop() {}
+9
View File
@@ -0,0 +1,9 @@
//! Crate-level docs.
/// Adds two numbers.
/// Returns the sum.
pub fn add(a: i32, b: i32) -> i32 {
// plain line comment
/* plain block comment */
a + b
}
@@ -0,0 +1,7 @@
//! Crate-level docs.
/// Adds two numbers.
/// Returns the sum.
pub fn add(a: i32, b: i32) -> i32 {
a + b
}