immosquare-cleaner 1.2.1 → 1.2.2
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/processors/prettier.rb +15 -0
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/package.json +1 -1
- 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: 8955a1cc723b8879a2b500cec45203853c478ba77f225dd271aeb2dd6fabf32e
|
|
4
|
+
data.tar.gz: 4cd13cd6271fc8eac845b4138fe64183c1325f2b0acd09a0243cb6be178f4fdf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: cd8d298e396a4956432fe9a7c38f653d4ef562f6516c2e8df3b124a9b0b74d106edf58f765c32a3260c8396d385b32b368c96979ea36b322c88837760ac4c964
|
|
7
|
+
data.tar.gz: 5cc16c3d0852e96e32d5d3e81046dcbeab39ef377dbcb0ebb4e1aa5c833edeb09a24aef1bac0c22f9b7e533bc15c79a2a467e921044f6bb6b6a5a9be57e8a2e6
|
|
@@ -29,6 +29,8 @@ module ImmosquareCleaner
|
|
|
29
29
|
].freeze
|
|
30
30
|
|
|
31
31
|
def run
|
|
32
|
+
return if erb_templated_yaml?
|
|
33
|
+
|
|
32
34
|
##============================================================##
|
|
33
35
|
## Prettier flags:
|
|
34
36
|
## --no-color : strip ANSI escape codes — VS Code Output panel
|
|
@@ -40,6 +42,19 @@ module ImmosquareCleaner
|
|
|
40
42
|
launch_cmds(cmds)
|
|
41
43
|
end
|
|
42
44
|
|
|
45
|
+
private
|
|
46
|
+
|
|
47
|
+
##============================================================##
|
|
48
|
+
## A YAML file holding ERB tags (Rails' database.yml, cable.yml…)
|
|
49
|
+
## is a template, not YAML. Prettier's YAML parser reads the Ruby
|
|
50
|
+
## inside the tags as YAML syntax: `a ? :ci : :personal` becomes
|
|
51
|
+
## `a ? :ci: :personal`, and a ternary in a value aborts with
|
|
52
|
+
## "Nested mappings are not allowed". Such files are left as is.
|
|
53
|
+
##============================================================##
|
|
54
|
+
def erb_templated_yaml?
|
|
55
|
+
file_path.end_with?(".yml", ".yaml") && File.read(file_path).include?("<%")
|
|
56
|
+
end
|
|
57
|
+
|
|
43
58
|
end
|
|
44
59
|
end
|
|
45
60
|
end
|
data/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"@typescript-eslint/eslint-plugin": "^8.71.0",
|
|
13
13
|
"@typescript-eslint/parser": "^8.71.0",
|
|
14
14
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
15
|
-
"eslint": "^10.
|
|
15
|
+
"eslint": "^10.12.0",
|
|
16
16
|
"eslint-plugin-align-import": "^1.0.0",
|
|
17
17
|
"eslint-plugin-erb": "^2.1.1",
|
|
18
18
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|