immosquare-cleaner 1.2.1 → 1.2.3
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 +23 -5
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/package.json +9 -9
- 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: 53d2dc2a160c411d3acbeb2dc03692343ef60b598468fe288bfca2ec85667e87
|
|
4
|
+
data.tar.gz: 802af16e18bb055b0f6a6a77b2e9ec47d2a1dab3d7a624ee848cd4f813f27e48
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c75021c32ffb683d464ef3834eb0e40bec740645f7be9afc045942b99093b160ad6e9867798858d37b030e34227a2f1b31df72895e9e376cd704f82af4e522a4
|
|
7
|
+
data.tar.gz: d4023816cebb368e5bff4bbc5ac7b824135532b2d738b74a0df0c530923a375bef4ee627a77f31d09ffd22d1e44bcc94f3e77d241963eb83ca142d8d039f98d8
|
|
@@ -29,17 +29,35 @@ 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
|
-
## --no-color
|
|
35
|
-
##
|
|
36
|
-
## --write
|
|
37
|
-
## --
|
|
36
|
+
## --no-color : strip ANSI escape codes — VS Code Output
|
|
37
|
+
## panel renders them as raw `ESC` characters
|
|
38
|
+
## --write : format the file in place
|
|
39
|
+
## --ignore-unknown : leave files Prettier has no parser for
|
|
40
|
+
## (bun.lock, LICENSE…) untouched instead of
|
|
41
|
+
## failing with "No parser could be inferred"
|
|
42
|
+
## --config : pin the shared config shipped with the gem
|
|
38
43
|
##============================================================##
|
|
39
|
-
cmds = ["bun prettier --no-color --write #{Shellwords.escape(file_path)} --config #{ImmosquareCleaner.gem_root}/linters/prettier.yml"]
|
|
44
|
+
cmds = ["bun prettier --no-color --write --ignore-unknown #{Shellwords.escape(file_path)} --config #{ImmosquareCleaner.gem_root}/linters/prettier.yml"]
|
|
40
45
|
launch_cmds(cmds)
|
|
41
46
|
end
|
|
42
47
|
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
##============================================================##
|
|
51
|
+
## A YAML file holding ERB tags (Rails' database.yml, cable.yml…)
|
|
52
|
+
## is a template, not YAML. Prettier's YAML parser reads the Ruby
|
|
53
|
+
## inside the tags as YAML syntax: `a ? :ci : :personal` becomes
|
|
54
|
+
## `a ? :ci: :personal`, and a ternary in a value aborts with
|
|
55
|
+
## "Nested mappings are not allowed". Such files are left as is.
|
|
56
|
+
##============================================================##
|
|
57
|
+
def erb_templated_yaml?
|
|
58
|
+
file_path.end_with?(".yml", ".yaml") && File.read(file_path).include?("<%")
|
|
59
|
+
end
|
|
60
|
+
|
|
43
61
|
end
|
|
44
62
|
end
|
|
45
63
|
end
|
data/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "immosquare-cleaner",
|
|
3
3
|
"//": [
|
|
4
|
-
"TypeScript 7
|
|
5
|
-
"ESLint
|
|
6
|
-
"
|
|
4
|
+
"TypeScript 7 provides tsc through @typescript/native.",
|
|
5
|
+
"ESLint and SonarJS use the TypeScript 6 API through the official @typescript/typescript6 alias.",
|
|
6
|
+
"Keep this alias until both tools support the native TypeScript API."
|
|
7
7
|
],
|
|
8
8
|
"private": true,
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@babel/parser": "^8.0.
|
|
10
|
+
"@babel/parser": "^8.0.7",
|
|
11
11
|
"@eslint/js": "^10.0.1",
|
|
12
|
-
"@typescript-eslint/eslint-plugin": "^8.71.
|
|
13
|
-
"@typescript-eslint/parser": "^8.71.
|
|
12
|
+
"@typescript-eslint/eslint-plugin": "^8.71.2",
|
|
13
|
+
"@typescript-eslint/parser": "^8.71.2",
|
|
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",
|
|
19
19
|
"eslint-plugin-sonarjs": "^4.2.2",
|
|
20
20
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
21
|
-
"prettier": "^3.9.
|
|
22
|
-
"typescript": "
|
|
21
|
+
"prettier": "^3.9.10",
|
|
22
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
23
23
|
}
|
|
24
24
|
}
|