Skip to content

Commit 3a7220f

Browse files
fix lint
1 parent 5eee8c9 commit 3a7220f

File tree

85 files changed

+273
-153
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+273
-153
lines changed

.eslintrc.js

-10
This file was deleted.

packages/config-eslint/base.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ const project = resolve(process.cwd(), "tsconfig.json");
44

55
/** @type {import("eslint").Linter.Config} */
66
module.exports = {
7-
extends: ["eslint:recommended", "prettier", "eslint-config-turbo"],
7+
extends: [
8+
"eslint:recommended",
9+
"prettier",
10+
"eslint-config-turbo",
11+
"plugin:@typescript-eslint/recommended",
12+
],
813
plugins: ["only-warn"],
914
globals: {
1015
React: true,
@@ -35,4 +40,4 @@ module.exports = {
3540
files: ["*.js?(x)", "*.ts?(x)"],
3641
},
3742
],
38-
};
43+
};

packages/config-eslint/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.0",
44
"license": "MIT",
55
"private": true,
6+
"main": "base.js",
67
"scripts": {
78
"clean": "rm -rf node_modules"
89
},

packages/config-vitest/package.json

-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@
44
"private": true,
55
"repository": "jimp-dev/jimp",
66
"scripts": {
7-
"lint": "eslint .",
87
"dev": "tshy --watch"
98
},
109
"author": "Andrew Lisowski <[email protected]>",
1110
"license": "MIT",
1211
"devDependencies": {
13-
"@jimp/config-eslint": "workspace:*",
1412
"@jimp/config-typescript": "workspace:*",
1513
"@jimp/test-utils": "workspace:*",
1614
"eslint": "^8.57.0",

packages/config-vitest/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

packages/core/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

packages/core/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

packages/diff/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

packages/diff/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

packages/docs/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"type": "module",
55
"version": "0.0.1",
66
"scripts": {
7-
"lint": "eslint .",
87
"dev": "astro dev",
98
"start": "astro dev",
109
"build-website": "rm -rf dist && astro check && astro build",

packages/jimp/.eslintrc copy.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

packages/jimp/src/callbacks.test.ts

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ describe("Callbacks", () => {
6262
const clone = targetImg.clone();
6363

6464
expect(
65+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6566
(clone[op as keyof typeof clone] as any)(...args)
6667
).toMatchSnapshot();
6768
});

packages/jimp/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

packages/read-file/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

packages/read-file/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

packages/test-utils/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

packages/test-utils/src/index.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,13 @@ import { expect } from "vitest";
22
import { Bitmap } from "@jimp/types";
33
import path from "path";
44

5+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
56
export function hashForEach<Hash extends Record<string, any>>(
67
hash: Hash,
78
func: (key: keyof Hash, value: Hash[keyof Hash]) => void
89
) {
910
for (const key in hash)
10-
if (hash.hasOwnProperty(key)) {
11+
if (key in hash) {
1112
func(key, hash[key]);
1213
}
1314
}
@@ -134,7 +135,7 @@ export function testImgToStr(testImage: Bitmap) {
134135
colors2[c] = k;
135136
});
136137

137-
let unknownColors = new Set<number>();
138+
const unknownColors = new Set<number>();
138139

139140
for (let y = 0; y < testImage.height; y++) {
140141
for (let x = 0; x < w; x++) {

packages/test-utils/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

packages/types/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

packages/types/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export interface Bitmap {
1414

1515
export interface Format<
1616
Mime extends string = string,
17+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1718
ExportOptions extends Record<string, any> | undefined = undefined,
1819
> {
1920
mime: Mime;
@@ -51,19 +52,23 @@ export interface JimpClass {
5152
getPixelColor: (x: number, y: number) => number;
5253
setPixelColor: (hex: number, x: number, y: number) => JimpClass;
5354

55+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
5456
scan(f: (x: number, y: number, idx: number) => any): JimpClass;
5557
scan(
5658
x: number,
5759
y: number,
5860
w: number,
5961
h: number,
62+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6063
cb: (x: number, y: number, idx: number) => any
6164
): JimpClass;
6265
scan(
66+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6367
x: number | ((x: number, y: number, idx: number) => any),
6468
y?: number,
6569
w?: number,
6670
h?: number,
71+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6772
f?: (x: number, y: number, idx: number) => any
6873
): JimpClass;
6974
}

packages/types/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

packages/utils/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

packages/utils/src/index.ts

+6
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ export function clone<I extends JimpClass>(image: I): I {
88
data: Buffer.from(image.bitmap.data),
99
};
1010

11+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1112
return new (image.constructor as any)(newBitmap);
1213
}
1314

1415
export function scan<I extends JimpClass>(
1516
image: I,
17+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1618
f: (this: I, x: number, y: number, idx: number) => any
1719
): I;
1820
export function scan<I extends { bitmap: Bitmap }>(
@@ -21,20 +23,24 @@ export function scan<I extends { bitmap: Bitmap }>(
2123
y: number,
2224
w: number,
2325
h: number,
26+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2427
cb: (x: number, y: number, idx: number) => any
2528
): I;
2629
export function scan<I extends { bitmap: Bitmap }>(
2730
image: I,
31+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2832
xArg: number | ((x: number, y: number, idx: number) => any),
2933
yArg?: number,
3034
wArg?: number,
3135
hArg?: number,
36+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3237
cbArg?: (x: number, y: number, idx: number) => any
3338
): I {
3439
let x: number;
3540
let y: number;
3641
let w: number;
3742
let h: number;
43+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3844
let cb: (x: number, y: number, idx: number) => any;
3945

4046
if (typeof xArg === "function") {

packages/utils/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

plugins/js-bmp/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

plugins/js-bmp/src/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export type { BmpColor } from "bmp-ts";
77
export { BmpCompression } from "bmp-ts";
88

99
type Pretty<T> = {
10+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1011
[K in keyof T]: T[K] extends (...args: any[]) => any
1112
? T[K]
1213
: T[K] extends object

plugins/js-bmp/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

plugins/js-gif/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

plugins/js-gif/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

plugins/js-jpeg/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

plugins/js-jpeg/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

plugins/js-png/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

plugins/js-png/tsconfig.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,5 @@
22
"extends": "@jimp/config-typescript/base.json",
33
"compilerOptions": {
44
"outDir": "dist"
5-
},
6-
"include": ["src"],
7-
"exclude": ["node_modules", "dist"]
8-
}
5+
}
6+
}

plugins/js-tiff/.eslintrc.cjs

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/** @type {import("eslint").Linter.Config} */
2+
module.exports = {
3+
root: true,
4+
extends: [require.resolve("@jimp/config-eslint/base.js")],
5+
};

0 commit comments

Comments
 (0)