Skip to content

Commit 417f534

Browse files
docs: mention extension must start with a . in with_extension (#313)
Fix comment
1 parent be378d8 commit 417f534

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/options.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,16 +210,16 @@ impl ResolveOptions {
210210
self
211211
}
212212

213-
/// Adds a single extension to the list of extensions
213+
/// Adds a single extension to the list of extensions. Extension must start with a `.`
214214
///
215215
/// ## Examples
216216
///
217217
/// ```
218218
/// use oxc_resolver::ResolveOptions;
219219
/// use std::path::{Path, PathBuf};
220220
///
221-
/// let options = ResolveOptions::default().with_extension("jsonc");
222-
/// assert!(options.extensions.contains(&"jsonc".to_string()));
221+
/// let options = ResolveOptions::default().with_extension(".jsonc");
222+
/// assert!(options.extensions.contains(&".jsonc".to_string()));
223223
/// ```
224224
#[must_use]
225225
pub fn with_extension<S: Into<String>>(mut self, extension: S) -> Self {

0 commit comments

Comments
 (0)