image-guard 5.2.4 → 5.2.5
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.
- package/CHANGELOG.md +7 -0
- package/bin/image-guard.test.js +5 -5
- package/eslint.config.js +5 -3
- package/package.json +2 -1
- package/src/index.js +1 -1
- package/src/utils.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,13 @@ Starting with version 5.2.0, all notable changes to Image Guard are documented i
|
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and the project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [5.2.5] - 2026-03-17
|
|
8
|
+
|
|
9
|
+
### Changed
|
|
10
|
+
|
|
11
|
+
* Added recommended ESLint rules to config (and fixed resulting warnings)
|
|
12
|
+
* Promoted `no-unused-vars` and `eqeqeq` from warnings to errors in ESLint config
|
|
13
|
+
|
|
7
14
|
## [5.2.4] - 2026-03-04
|
|
8
15
|
|
|
9
16
|
### Fixed
|
package/bin/image-guard.test.js
CHANGED
|
@@ -305,7 +305,7 @@ describe('Image Guard', () => {
|
|
|
305
305
|
copyFiles(testFolder, tempTestFolder)
|
|
306
306
|
|
|
307
307
|
const originalCwd = process.cwd()
|
|
308
|
-
let stdout
|
|
308
|
+
let stdout
|
|
309
309
|
try {
|
|
310
310
|
process.chdir(tempDir)
|
|
311
311
|
stdout = execSync(`node "${imageGuardScript}" --quiet`, { encoding: 'utf8' })
|
|
@@ -333,7 +333,7 @@ describe('Image Guard', () => {
|
|
|
333
333
|
})
|
|
334
334
|
|
|
335
335
|
const originalCwd = process.cwd()
|
|
336
|
-
let stdout
|
|
336
|
+
let stdout
|
|
337
337
|
try {
|
|
338
338
|
process.chdir(tempDir)
|
|
339
339
|
stdout = execSync(`node "${imageGuardScript}" --dry --quiet`, { encoding: 'utf8' })
|
|
@@ -467,7 +467,7 @@ describe('Image Guard', () => {
|
|
|
467
467
|
const filesBefore = fs.readdirSync(tempTestFolder).sort()
|
|
468
468
|
|
|
469
469
|
const originalCwd = process.cwd()
|
|
470
|
-
let output
|
|
470
|
+
let output
|
|
471
471
|
try {
|
|
472
472
|
process.chdir(tempDir)
|
|
473
473
|
output = execSync(`node "${imageGuardScript}" --heic-to-avif --dry`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] })
|
|
@@ -520,7 +520,7 @@ describe('Image Guard', () => {
|
|
|
520
520
|
copyFiles(testFolder, tempTestFolder)
|
|
521
521
|
|
|
522
522
|
const originalCwd = process.cwd()
|
|
523
|
-
let output
|
|
523
|
+
let output
|
|
524
524
|
try {
|
|
525
525
|
process.chdir(tempDir)
|
|
526
526
|
output = execSync(`node "${imageGuardScript}"`, { encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'] })
|
|
@@ -538,7 +538,7 @@ describe('Image Guard', () => {
|
|
|
538
538
|
copyFiles(testFolder, tempTestFolder)
|
|
539
539
|
|
|
540
540
|
const originalCwd = process.cwd()
|
|
541
|
-
let output
|
|
541
|
+
let output
|
|
542
542
|
try {
|
|
543
543
|
process.chdir(tempDir)
|
|
544
544
|
output = execSync(`node "${imageGuardScript}" --keep-heic 2>&1`, { encoding: 'utf8' })
|
package/eslint.config.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
|
|
1
3
|
export default [
|
|
2
4
|
{
|
|
3
5
|
ignores: [
|
|
@@ -5,6 +7,7 @@ export default [
|
|
|
5
7
|
'node_modules/**'
|
|
6
8
|
]
|
|
7
9
|
},
|
|
10
|
+
js.configs.recommended,
|
|
8
11
|
{
|
|
9
12
|
languageOptions: {
|
|
10
13
|
ecmaVersion: 'latest',
|
|
@@ -17,9 +20,8 @@ export default [
|
|
|
17
20
|
},
|
|
18
21
|
rules: {
|
|
19
22
|
'no-console': 'off', // CLI tool—allow console
|
|
20
|
-
'no-
|
|
21
|
-
|
|
22
|
-
eqeqeq: ['warn', 'smart'],
|
|
23
|
+
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
|
|
24
|
+
eqeqeq: ['error', 'smart'],
|
|
23
25
|
curly: ['warn', 'multi-line']
|
|
24
26
|
}
|
|
25
27
|
}
|
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"description": "Near-lossless image compressor that’s easy to use and easy to automate",
|
|
15
15
|
"devDependencies": {
|
|
16
|
+
"@eslint/js": "^10.0.0",
|
|
16
17
|
"eslint": "^10.0.0"
|
|
17
18
|
},
|
|
18
19
|
"funding": "https://github.com/j9t/image-guard?sponsor=1",
|
|
@@ -46,5 +47,5 @@
|
|
|
46
47
|
"test": "node --test bin/image-guard.test.js"
|
|
47
48
|
},
|
|
48
49
|
"type": "module",
|
|
49
|
-
"version": "5.2.
|
|
50
|
+
"version": "5.2.5"
|
|
50
51
|
}
|
package/src/index.js
CHANGED
package/src/utils.js
CHANGED
|
@@ -283,6 +283,6 @@ const size = async (file) => {
|
|
|
283
283
|
return stats.size
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
const sizeReadable = (size) => `${(size / 1024).toFixed(2)} KB`
|
|
286
|
+
const sizeReadable = (size) => `${(size / 1024).toFixed(2)} KB` // eslint-disable-line no-irregular-whitespace
|
|
287
287
|
|
|
288
288
|
export const utils = { compression, conversion, sizeReadable }
|