Skip to content

Commit 1132c95

Browse files
committed
Added JS imports
1 parent 9abd7e6 commit 1132c95

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

stackmuncher_lib/src/ignore_paths.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fn test_compile_ignore_paths() {
1616

1717
/// A list of path fragments, file names, file extensions as Regex.
1818
/// Files with the path matching any of regex from this list are ignored.
19-
const IGNORE_PATHS: [&str; 25] = [
19+
const IGNORE_PATHS: [&str; 39] = [
2020
// known framework paths
2121
r#"node_modules[/\\]"#,
2222
r#"angular[/\\]README\.md"#,
@@ -27,6 +27,22 @@ const IGNORE_PATHS: [&str; 25] = [
2727
r#"\.jpg$"#,
2828
r#"\.jpeg$"#,
2929
r#"\.gif$"#,
30+
r#"\.svg$"#,
31+
r#"\.bmp$"#,
32+
r#"\.tif$"#,
33+
r#"\.tiff$"#,
34+
r#"\.eps$"#,
35+
r#"\.webp$"#,
36+
// audio / video
37+
r#"\.mp4$"#,
38+
r#"\.mp3$"#,
39+
r#"\.mpeg$"#,
40+
// fonts
41+
r#"\.ttf$"#,
42+
r#"\.otf$"#,
43+
r#"\.eot$"#,
44+
r#"\.woff$"#,
45+
r#"\.woff2$"#,
3046
// documents
3147
r#"\.pdf$"#,
3248
r#"\.doc$"#,

stackmuncher_lib/stm_rules/munchers/js.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@
1616
],
1717
"block_comments_end": [
1818
"(?i)\\*/\\s*$"
19+
],
20+
"refs": [
21+
"^[[:blank:]]*import[[:blank:]]+.*[[:blank:]]*['\"]([@A-Za-z0-9_][@A-Za-z0-9_\\-\\.]+).*['\"]",
22+
"[[:blank:]]*require[[:blank:]]*\\([[:blank:]]*['\"]([@A-Za-z0-9_][@A-Za-z0-9_\\-\\.]+)[^'\"]*['\"][[:blank:]]*\\)"
1923
]
2024
}

0 commit comments

Comments
 (0)