immosquare-cleaner 0.1.105 → 0.1.106
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/erb.rb +12 -0
- data/lib/immosquare-cleaner/processors/prettier.rb +8 -1
- data/lib/immosquare-cleaner/processors/ruby.rb +8 -0
- data/lib/immosquare-cleaner/processors/shell.rb +5 -0
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/linters/eslint.config.mjs +10 -1
- data/package.json +5 -4
- 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: c9eccbce72faba4409cd870659372cfcc672cbda036f3c8d6c10a50be39ef6aa
|
|
4
|
+
data.tar.gz: e87c682be15dc425e5244deb8fac15a26f8f8ca48ef16b70bab475b6d2ebcf4c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b51fbc1471276ec2ed56c37d0f819b36cc8f494e48afec323d7d00a1732c27bed8c5619a5c2a2780c20ee8624095e574dde692781d1b7f674cdb944f74c19b64
|
|
7
|
+
data.tar.gz: 4133648ea30b37094c6324e1b062c87d8b788e5e7296af113cb865463b0ee247a8f84ad8fabbbe9556fecc5ffa59a9c63772b5ee0c6651a1e4c638aebd0abd03
|
|
@@ -10,6 +10,18 @@ module ImmosquareCleaner
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def run
|
|
13
|
+
##============================================================##
|
|
14
|
+
## htmlbeautifier flags:
|
|
15
|
+
## --keep-blank-lines 4 : preserve up to 4 consecutive blank
|
|
16
|
+
## lines (default 1 collapses spacing
|
|
17
|
+
## we want to keep in long views)
|
|
18
|
+
##
|
|
19
|
+
## erb_lint flags:
|
|
20
|
+
## --config : pin the shared config (versioned per
|
|
21
|
+
## Ruby version, inherits the matching
|
|
22
|
+
## rubocop-X.Y.Z.yml)
|
|
23
|
+
## --autocorrect : apply autocorrectable offenses in place
|
|
24
|
+
##============================================================##
|
|
13
25
|
config_path = "#{ImmosquareCleaner.gem_root}/linters/erb-lint-#{RUBY_VERSION}.yml"
|
|
14
26
|
htmlbeautifier_options = ImmosquareCleaner.configuration.htmlbeautifier_options || "--keep-blank-lines 4"
|
|
15
27
|
erblint_options = ImmosquareCleaner.configuration.erblint_options || "--autocorrect"
|
|
@@ -11,7 +11,14 @@ module ImmosquareCleaner
|
|
|
11
11
|
class Prettier < Base
|
|
12
12
|
|
|
13
13
|
def run
|
|
14
|
-
|
|
14
|
+
##============================================================##
|
|
15
|
+
## Prettier flags:
|
|
16
|
+
## --no-color : strip ANSI escape codes — VS Code Output panel
|
|
17
|
+
## renders them as raw `ESC` characters
|
|
18
|
+
## --write : format the file in place
|
|
19
|
+
## --config : pin the shared config shipped with the gem
|
|
20
|
+
##============================================================##
|
|
21
|
+
cmds = ["bun prettier --no-color --write #{Shellwords.escape(file_path)} --config #{ImmosquareCleaner.gem_root}/linters/prettier.yml"]
|
|
15
22
|
launch_cmds(cmds)
|
|
16
23
|
end
|
|
17
24
|
|
|
@@ -38,6 +38,14 @@ module ImmosquareCleaner
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def run
|
|
41
|
+
##============================================================##
|
|
42
|
+
## RuboCop flags:
|
|
43
|
+
## -c : pin the shared config (versioned per
|
|
44
|
+
## Ruby version to handle parser drift)
|
|
45
|
+
## --autocorrect-all : apply both safe and unsafe corrections
|
|
46
|
+
## --no-parallel : single-file run, parallelism is wasted
|
|
47
|
+
## overhead and breaks custom cop loading
|
|
48
|
+
##============================================================##
|
|
41
49
|
rubocop_options = ImmosquareCleaner.configuration.rubocop_options || "--autocorrect-all --no-parallel"
|
|
42
50
|
config_path = "#{ImmosquareCleaner.gem_root}/linters/rubocop-#{RUBY_VERSION}.yml"
|
|
43
51
|
|
|
@@ -19,6 +19,11 @@ module ImmosquareCleaner
|
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
def run
|
|
22
|
+
##============================================================##
|
|
23
|
+
## shfmt flags:
|
|
24
|
+
## -i 2 : indent with 2 spaces (default uses tabs)
|
|
25
|
+
## -w : write the result back to the file in place
|
|
26
|
+
##============================================================##
|
|
22
27
|
if system("which shfmt > /dev/null 2>&1")
|
|
23
28
|
cmds = ["shfmt -i 2 -w #{Shellwords.escape(file_path)}"]
|
|
24
29
|
launch_cmds(cmds)
|
data/linters/eslint.config.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import js from "@eslint/js"
|
|
2
2
|
import preferArrow from "eslint-plugin-prefer-arrow"
|
|
3
3
|
import sonarjs from "eslint-plugin-sonarjs"
|
|
4
|
+
import unusedImports from "eslint-plugin-unused-imports"
|
|
4
5
|
import { alignAssignments, alignImport } from "./eslint-plugins/eslint10-compat.mjs"
|
|
5
6
|
import erb from "eslint-plugin-erb"
|
|
6
7
|
import tseslint from "@typescript-eslint/eslint-plugin"
|
|
@@ -99,7 +100,14 @@ const commonRules = {
|
|
|
99
100
|
//============================================================//
|
|
100
101
|
// Disallow magic numbers
|
|
101
102
|
//============================================================//
|
|
102
|
-
"no-magic-numbers": ["off", { ignore: [], ignoreArrayIndexes: true, enforceConst: true, detectObjects: false }]
|
|
103
|
+
"no-magic-numbers": ["off", { ignore: [], ignoreArrayIndexes: true, enforceConst: true, detectObjects: false }],
|
|
104
|
+
|
|
105
|
+
//============================================================//
|
|
106
|
+
// Unused imports: autofix-able, removes the import statement.
|
|
107
|
+
// Unused vars are intentionally NOT enabled here — removing
|
|
108
|
+
// function bodies / locals on save is too disruptive.
|
|
109
|
+
//============================================================//
|
|
110
|
+
"unused-imports/no-unused-imports": [2]
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
//============================================================//
|
|
@@ -108,6 +116,7 @@ const commonRules = {
|
|
|
108
116
|
const commonPlugins = {
|
|
109
117
|
"prefer-arrow": preferArrow,
|
|
110
118
|
"sonarjs": sonarjs,
|
|
119
|
+
"unused-imports": unusedImports,
|
|
111
120
|
"align-assignments": alignAssignments,
|
|
112
121
|
"align-import": alignImport
|
|
113
122
|
}
|
data/package.json
CHANGED
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
"name": "immosquare-cleaner",
|
|
3
3
|
"private": true,
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@babel/parser": "^7.29.
|
|
5
|
+
"@babel/parser": "^7.29.3",
|
|
6
6
|
"@eslint/js": "^10.0.1",
|
|
7
|
-
"@typescript-eslint/eslint-plugin": "^8.59.
|
|
8
|
-
"@typescript-eslint/parser": "^8.59.
|
|
9
|
-
"eslint": "^10.
|
|
7
|
+
"@typescript-eslint/eslint-plugin": "^8.59.2",
|
|
8
|
+
"@typescript-eslint/parser": "^8.59.2",
|
|
9
|
+
"eslint": "^10.3.0",
|
|
10
10
|
"eslint-plugin-align-assignments": "^1.1.2",
|
|
11
11
|
"eslint-plugin-align-import": "^1.0.0",
|
|
12
12
|
"eslint-plugin-erb": "^2.1.1",
|
|
13
13
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
14
14
|
"eslint-plugin-sonarjs": "^4.0.3",
|
|
15
|
+
"eslint-plugin-unused-imports": "^4.4.1",
|
|
15
16
|
"prettier": "^3.8.3",
|
|
16
17
|
"typescript": "^6.0.3"
|
|
17
18
|
}
|