From a66315d232b49e623268de801af19460108ba514 Mon Sep 17 00:00:00 2001 From: Linda_pp Date: Wed, 31 Aug 2022 21:11:13 +0900 Subject: [PATCH] ignore/types: add *.cjs, *.mjs, *.cts, *.mts These are used by both Node.js and TypeScript to indicate that a file is CommonJS or ES. Node.js: https://nodejs.org/api/esm.html TypeScript: https://www.typescriptlang.org/docs/handbook/esm-node.html#new-file-extensions PR #2297 --- crates/ignore/src/default_types.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/ignore/src/default_types.rs b/crates/ignore/src/default_types.rs index 6f0c8339..b3a5c958 100644 --- a/crates/ignore/src/default_types.rs +++ b/crates/ignore/src/default_types.rs @@ -95,7 +95,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("java", &["*.java", "*.jsp", "*.jspx", "*.properties"]), ("jinja", &["*.j2", "*.jinja", "*.jinja2"]), ("jl", &["*.jl"]), - ("js", &["*.js", "*.jsx", "*.vue"]), + ("js", &["*.js", "*.jsx", "*.vue", "*.cjs", "*.mjs"]), ("json", &["*.json", "composer.lock"]), ("jsonl", &["*.jsonl"]), ("julia", &["*.jl"]), @@ -248,7 +248,7 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[ ("tf", &["*.tf"]), ("thrift", &["*.thrift"]), ("toml", &["*.toml", "Cargo.lock"]), - ("ts", &["*.ts", "*.tsx"]), + ("ts", &["*.ts", "*.tsx", "*.cts", "*.mts"]), ("twig", &["*.twig"]), ("txt", &["*.txt"]), ("typoscript", &["*.typoscript", "*.ts"]),