Skip to content

Commit fe1a73c

Browse files
committed
fix(config): Don't treat ts as typoscript
Fixes #911
1 parent d543202 commit fe1a73c

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

crates/typos-cli/src/default_types.rs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
261261
("ts", &["*.ts", "*.tsx"]),
262262
("twig", &["*.twig"]),
263263
("txt", &["*.txt"]),
264-
("typoscript", &["*.typoscript", "*.ts"]),
264+
("typoscript", &["*.typoscript"]),
265265
("vala", &["*.vala"]),
266266
("vb", &["*.vb"]),
267267
("vcl", &["*.vcl"]),
@@ -292,3 +292,20 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
292292
]),
293293
("zstd", &["*.zst", "*.zstd"]),
294294
];
295+
296+
// See `cargo test --lib -- --nocapture default_types::check_duplicates`
297+
#[test]
298+
fn check_duplicates() {
299+
let mut reverse = std::collections::BTreeMap::new();
300+
for (name, exts) in DEFAULT_TYPES {
301+
for ext in *exts {
302+
reverse.entry(ext).or_insert(Vec::new()).push(name);
303+
}
304+
}
305+
306+
for (ext, names) in reverse {
307+
if 1 < names.len() {
308+
println!("{ext} is under multiple names: {names:?}");
309+
}
310+
}
311+
}

0 commit comments

Comments
 (0)