Skip to content

Commit

Permalink
fix(config): Don't treat ts as typoscript
Browse files Browse the repository at this point in the history
Fixes #911
  • Loading branch information
epage committed Jan 19, 2024
1 parent d543202 commit fe1a73c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion crates/typos-cli/src/default_types.rs
Expand Up @@ -261,7 +261,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
("ts", &["*.ts", "*.tsx"]),
("twig", &["*.twig"]),
("txt", &["*.txt"]),
("typoscript", &["*.typoscript", "*.ts"]),
("typoscript", &["*.typoscript"]),
("vala", &["*.vala"]),
("vb", &["*.vb"]),
("vcl", &["*.vcl"]),
Expand Down Expand Up @@ -292,3 +292,20 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
]),
("zstd", &["*.zst", "*.zstd"]),
];

// See `cargo test --lib -- --nocapture default_types::check_duplicates`
#[test]
fn check_duplicates() {
let mut reverse = std::collections::BTreeMap::new();
for (name, exts) in DEFAULT_TYPES {
for ext in *exts {
reverse.entry(ext).or_insert(Vec::new()).push(name);
}
}

for (ext, names) in reverse {
if 1 < names.len() {
println!("{ext} is under multiple names: {names:?}");
}
}
}

0 comments on commit fe1a73c

Please sign in to comment.