chore: upgrade eslint from v8 to v9#475
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #475 +/- ##
==========================================
+ Coverage 77.16% 77.51% +0.34%
==========================================
Files 4 4
Lines 727 756 +29
Branches 282 307 +25
==========================================
+ Hits 561 586 +25
- Misses 137 141 +4
Partials 29 29 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/index.js
Outdated
| const generators = Array.isArray(this.options.generator) | ||
| ? this.options.generator.filter((item) => item.type === "asset") | ||
| ? this.options.generator.filter( | ||
| (item) => !item.type || item.type === "asset", |
src/utils.js
Outdated
| if (check([0x57, 0x45, 0x42, 0x50], { offset: 8 })) { | ||
| if ( | ||
| check([0x52, 0x49, 0x46, 0x46]) && | ||
| check([0x57, 0x45, 0x42, 0x50], { offset: 8 }) |
src/utils.js
Outdated
| async function squooshImagePoolTeardown() { | ||
| if (pool) { | ||
| await pool.close(); | ||
| await /** @type {{close(): Promise<void>}} */ (pool).close(); |
There was a problem hiding this comment.
Describe the pool variable
src/utils.js
Outdated
| const imagePool = | ||
| /** @type {{ingestImage(data: Uint8Array): {preprocess(options: Record<string, unknown>): Promise<void>, encode(options: Record<string, unknown>): Promise<void>, encodedWith: Record<string, {binary: Uint8Array, extension: string}>, decoded: {bitmap: {width: number, height: number}}}, close(): Promise<void>}} */ ( | ||
| pool || squooshImagePoolCreate() | ||
| ); |
There was a problem hiding this comment.
Please remove it from everywhere and make a new type, then reuse this type for the pool variable and for return for squooshImagePoolCreate
src/utils.js
Outdated
| if (!encodeOptions[targetCodec]) { | ||
| encodeOptions[targetCodec] = {}; | ||
| if (!(/** @type {Record<string, unknown>} */ (encodeOptions)[targetCodec])) { | ||
| /** @type {Record<string, unknown>} */ (encodeOptions)[targetCodec] = {}; |
There was a problem hiding this comment.
It should be not Record<string, unknown>, other options too
src/worker.js
Outdated
| warnings: [], | ||
| errors: [], | ||
| info: { | ||
| ...options.info, |
alexander-akait
left a comment
There was a problem hiding this comment.
Please in future when you change a code - add comments why it was changed, also please fix the problem above
This PR contains a:
Motivation / Use-Case
upgrade eslint from v8 to v9
Breaking Changes
No
Additional Info
No