immosquare-cleaner 0.1.94 → 0.1.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/lib/immosquare-cleaner.rb +1 -1
- data/lib/tasks/immosquare_cleaner.rake +10 -1
- data/linters/normalize-comments.mjs +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef4743e368013a24d51795c0401fb25551318cf708de34ede70da2463732fb14
|
|
4
|
+
data.tar.gz: d071271dcda68ef78e8c042217d39ba13f484b8081e120384c7c01b3c8e0deaa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11cda1db31886b571cf81a294798e080eef10e30870adeb23071d37242415d047e0b7916c3c6af0bca855f116c49808a2bd38aeba1744f7e29bd1fbd768a5385
|
|
7
|
+
data.tar.gz: 2451ad2ef109bf3847a554d7d557bd182e24fae97c7be882e85e8ff1392cffc0a14258f724b2197e386ca6905a51e46c302d2c54d483eea8fc3b5ecd748b5520
|
data/lib/immosquare-cleaner.rb
CHANGED
|
@@ -168,7 +168,7 @@ module ImmosquareCleaner
|
|
|
168
168
|
File.write(temp_file_path, File.read(file_path))
|
|
169
169
|
cmds = []
|
|
170
170
|
cmds << "bundle exec erb_lint --config #{erblint_config_with_version_path} #{file_path} #{ImmosquareCleaner.configuration.erblint_options || "--autocorrect"}" if file_path.end_with?(".erb")
|
|
171
|
-
cmds << "bun #{gem_root}/linters/normalize-comments.mjs #{temp_file_path}"
|
|
171
|
+
cmds << "bun #{gem_root}/linters/normalize-comments.mjs #{temp_file_path}" if !file_path.end_with?(".erb")
|
|
172
172
|
cmds << "bun eslint --config #{gem_root}/linters/eslint.config.mjs #{temp_file_path} --fix"
|
|
173
173
|
|
|
174
174
|
launch_cmds(cmds)
|
|
@@ -21,8 +21,17 @@ namespace :immosquare_cleaner do
|
|
|
21
21
|
".lock",
|
|
22
22
|
".lockb",
|
|
23
23
|
".otf",
|
|
24
|
-
".ttf"
|
|
24
|
+
".ttf",
|
|
25
|
+
".png",
|
|
26
|
+
".jpg",
|
|
27
|
+
".jpeg",
|
|
28
|
+
".gif",
|
|
29
|
+
".svg",
|
|
30
|
+
".ico",
|
|
31
|
+
".webp",
|
|
32
|
+
".csv"
|
|
25
33
|
]
|
|
34
|
+
|
|
26
35
|
file_paths = Dir.glob("#{Rails.root}/**/*").reject do |file_path|
|
|
27
36
|
File.directory?(file_path) || file_path.gsub("#{Rails.root}/", "").start_with?(*paths_to_exclude) || file_path.end_with?(*extensions_to_exclude)
|
|
28
37
|
end
|
|
@@ -87,6 +87,18 @@ const groupConsecutiveComments = (comments, originalLines) => {
|
|
|
87
87
|
return
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
//============================================================//
|
|
91
|
+
// Skip Sprockets directives (//= link, //= require, etc.)
|
|
92
|
+
//============================================================//
|
|
93
|
+
if (comment.value.startsWith("=")) {
|
|
94
|
+
if (currentBlock.length > 0) {
|
|
95
|
+
blocks.push(currentBlock)
|
|
96
|
+
currentBlock = []
|
|
97
|
+
}
|
|
98
|
+
lastLine = -2
|
|
99
|
+
return
|
|
100
|
+
}
|
|
101
|
+
|
|
90
102
|
//============================================================//
|
|
91
103
|
// Check if this is a standalone comment (line starts with //)
|
|
92
104
|
// Skip end-of-line comments (e.g., const x = 1 // comment)
|