Skip to content

Commit 5c0ae3b

Browse files
committed
update eslint - ts - prettier
1 parent eb9c2ff commit 5c0ae3b

File tree

12 files changed

+940
-862
lines changed

12 files changed

+940
-862
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 32 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
node_modules
2-
.eslintcache
3-
*.js

.prettierignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

2023/06/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type test_1 = Expect<Equal<test_1_expected, test_1_actual>>;
2323
type test_2_actual = FilterChildrenBy<
2424
// ^?
2525
string | number | (() => void),
26-
// eslint-disable-next-line @typescript-eslint/ban-types
26+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
2727
Function
2828
>;
2929
type test_2_expected = string | number;

2023/11/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Expect, Equal } from "type-testing";
22

33
type DeepReadonly<T> = {
4-
// eslint-disable-next-line @typescript-eslint/ban-types
4+
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
55
readonly [K in keyof T]: T[K] extends Function ? T[K] : DeepReadonly<T[K]>;
66
};
77

2023/20/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ interface Letters {
2020
"*": ["░", "#", "░"];
2121
}
2222

23-
type PrintRow<
24-
T extends string,
25-
Row extends 0 | 1 | 2,
26-
> = Uppercase<T> extends `${infer Letter extends keyof Letters}${infer Rest}`
27-
? `${Letters[Letter][Row]}${PrintRow<Rest, Row>}`
28-
: "";
23+
type PrintRow<T extends string, Row extends 0 | 1 | 2> =
24+
Uppercase<T> extends `${infer Letter extends keyof Letters}${infer Rest}`
25+
? `${Letters[Letter][Row]}${PrintRow<Rest, Row>}`
26+
: "";
2927

3028
type ToAsciiArt<T extends string> = T extends `${infer First}\n${infer Rest}`
3129
? [...ToAsciiArt<First>, ...ToAsciiArt<Rest>]

eslint.config.mjs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// @ts-check
2+
3+
import eslint from "@eslint/js";
4+
import tseslint from "typescript-eslint";
5+
6+
export default tseslint.config(
7+
eslint.configs.recommended,
8+
tseslint.configs.strict,
9+
tseslint.configs.stylistic,
10+
11+
{
12+
files: ["**/*.ts"],
13+
rules: {
14+
"@typescript-eslint/no-unused-vars": [
15+
"error",
16+
{
17+
args: "all",
18+
argsIgnorePattern: "^_",
19+
caughtErrors: "all",
20+
caughtErrorsIgnorePattern: "^_",
21+
destructuredArrayIgnorePattern: "^_",
22+
varsIgnorePattern: ".*",
23+
ignoreRestSiblings: true,
24+
},
25+
],
26+
},
27+
},
28+
);

package.json

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
11
{
22
"name": "advent-of-typescript",
33
"version": "1.0.0",
4-
"main": "index.ts",
5-
"type": "module",
4+
"author": "zyhou",
65
"scripts": {
76
"start": "tsc --watch ./$YEAR/$DAY/index.ts",
8-
"typecheck": "tsc -p tsconfig.base.json",
9-
"lint": "eslint . --cache",
7+
"typecheck": "tsc",
8+
"lint": "eslint .",
109
"lint:fix": "eslint . --fix",
11-
"format": "prettier . --write --ignore-unknown --cache",
10+
"format": "prettier . --write --ignore-unknown",
1211
"format:ci": "prettier . --check --ignore-unknown"
1312
},
14-
"author": "zyhou",
1513
"devDependencies": {
16-
"@types/node": "^20.10.1",
17-
"@typescript-eslint/eslint-plugin": "^6.13.1",
18-
"@typescript-eslint/parser": "^6.13.1",
19-
"eslint": "^8.54.0",
20-
"prettier": "4.0.0-alpha.2",
21-
"typescript": "^5.3.2"
14+
"@eslint/js": "^9.16.0",
15+
"@types/node": "^22.10.1",
16+
"eslint": "^9.16.0",
17+
"prettier": "^3.4.1",
18+
"typescript": "^5.7.2",
19+
"typescript-eslint": "^8.17.0"
2220
},
2321
"dependencies": {
2422
"type-testing": "^0.2.0"

0 commit comments

Comments
 (0)