Skip to content

Commit 023b548

Browse files
authored
Merge pull request #338 from LeetCode-OpenSource/chore/bump-deps
chore: bump deps
2 parents 937d4ed + b4ecbf9 commit 023b548

File tree

9 files changed

+802
-3580
lines changed

9 files changed

+802
-3580
lines changed

.eslintignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# from .gitignore
2+
node_modules/
3+
coverage/
4+
dist/
5+
.idea
6+
.cache
7+
*.tgz
8+
.DS_Store
9+
esm
10+
esnext
11+
12+
# custom ignore pattern
13+
*.html

.eslintrc.json

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"plugins": ["@typescript-eslint"],
3+
"parser": "@typescript-eslint/parser",
4+
"extends": [
5+
"plugin:@typescript-eslint/recommended",
6+
"prettier"
7+
],
8+
"globals": {
9+
"Atomics": "readonly",
10+
"SharedArrayBuffer": "readonly"
11+
},
12+
"rules": {
13+
"@typescript-eslint/explicit-member-accessibility": [
14+
"error",
15+
{
16+
"accessibility": "no-public",
17+
"overrides": {
18+
"parameterProperties": "explicit"
19+
}
20+
}
21+
],
22+
"@typescript-eslint/explicit-module-boundary-types": "off",
23+
"@typescript-eslint/explicit-function-return-type": "off",
24+
"@typescript-eslint/no-non-null-assertion": "off",
25+
"@typescript-eslint/no-parameter-properties": "off",
26+
"@typescript-eslint/no-use-before-define": ["error", { "functions": false, "classes": false }],
27+
"@typescript-eslint/no-explicit-any": "off",
28+
"@typescript-eslint/no-var-requires": "off",
29+
"@typescript-eslint/ban-ts-comment": "off",
30+
"no-console": ["error", { "allow": ["warn", "error"] }]
31+
},
32+
"settings": {
33+
"react": {
34+
"version": "detect"
35+
}
36+
},
37+
"env": {
38+
"browser": true,
39+
"es6": true
40+
},
41+
"parserOptions": {
42+
"project": "./tsconfig.json",
43+
"extraFileExtensions": [".html"],
44+
"ecmaFeatures": {
45+
"jsx": true
46+
},
47+
"ecmaVersion": 2018,
48+
"sourceType": "module"
49+
}
50+
}

jest.config.js

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

package.json

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616
},
1717
"homepage": "https://github.com/LeetCode-OpenSource/typed-path-generator#readme",
1818
"scripts": {
19-
"test": "jest",
20-
"build": "rm -rf ./dist && tsc -p ./tsconfig.json"
19+
"build": "rm -rf ./dist && tsc -p ./tsconfig.json",
20+
"lint": "yarn lint:eslint && yarn lint:tsc",
21+
"lint:eslint": "eslint . --ext .ts,.tsx --fix --max-warnings 0"
2122
},
2223
"keywords": [
2324
"route",
@@ -36,26 +37,24 @@
3637
"lint-staged": {
3738
"*.{ts,tsx}": [
3839
"prettier --write",
39-
"tslint -p tsconfig.json --fix",
40+
"yarn lint:eslint",
4041
"git add"
4142
]
4243
},
4344
"devDependencies": {
4445
"@types/glob": "^7.1.1",
45-
"@types/jest": "^26.0.0",
4646
"@types/js-yaml": "^4.0.0",
4747
"@types/lodash": "^4.14.122",
4848
"@types/node": "^14.0.1",
4949
"@types/prettier": "^2.0.0",
5050
"@types/qs": "^6.5.2",
51+
"@typescript-eslint/eslint-plugin": "^4.18.0",
52+
"@typescript-eslint/parser": "^4.18.0",
53+
"eslint": "7.22.0",
54+
"eslint-config-prettier": "^8.1.0",
5155
"husky": "^5.2.0",
52-
"jest": "^25.1.0",
5356
"lint-staged": "^10.0.1",
54-
"ts-jest": "^25.0.0",
55-
"tslint": "^5.13.1",
56-
"tslint-eslint-rules": "^5.4.0",
57-
"tslint-sonarts": "^1.9.0",
58-
"typescript": "^3.3.3333"
57+
"typescript": "^4.2"
5958
},
6059
"dependencies": {
6160
"chalk": "^4.0.0",

src/cli/generate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ interface ImportInfo {
1919
}
2020

2121
interface ParseResult {
22-
staticPath: { [key: string]: object | string }
23-
pathFactory: { [key: string]: object | string }
24-
ParamsInterface: { [key: string]: object | string }
22+
staticPath: { [key: string]: Record<string, unknown> | string }
23+
pathFactory: { [key: string]: Record<string, unknown> | string }
24+
ParamsInterface: { [key: string]: Record<string, unknown> | string }
2525
importInfo: ImportInfo
2626
}
2727

src/cli/logger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class Logger extends BasicLogger {
4545
super()
4646
}
4747

48-
log(message: string, status: LoggerStatus) {
48+
log(message: string, status: LoggerStatus): void {
4949
Logger.updateInfos({ key: this.key, message, status })
5050
}
5151
}

src/cli/utils.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const getDefaultOptions = (): Options => ({
2020
},
2121
})
2222

23-
export function codeStringify(code: object): string {
23+
export function codeStringify(code: Record<string, unknown>): string {
2424
const replaceInfo: { origin: string; stringified: string }[] = []
2525
const stringifiedCode = JSON.stringify(code, collectReplaceInfo)
2626

@@ -30,7 +30,7 @@ export function codeStringify(code: object): string {
3030
stringifiedCode,
3131
)
3232

33-
function collectReplaceInfo(_key: string, value: string | object) {
33+
function collectReplaceInfo(_key: string, value: string | Record<string, unknown>) {
3434
if (typeof value === 'string') {
3535
replaceInfo.push({
3636
origin: value,
@@ -52,10 +52,10 @@ export function loadYAML(yaml: string): YAML {
5252
}
5353

5454
export function recursiveForEach<Output>(
55-
obj: any,
55+
obj: Record<string, any>,
5656
translate: (value: any, path: string[]) => Output,
5757
parentPath: string[] = [],
58-
) {
58+
): void {
5959
Object.keys(obj).forEach((key) => {
6060
const currentPath = [...parentPath, key]
6161
const value = obj[key]
@@ -146,6 +146,6 @@ function makeTypeString(Type: ParamsType) {
146146
}
147147
}
148148

149-
export function mergeTypeString(...types: string[]) {
149+
export function mergeTypeString(...types: string[]): string {
150150
return types.filter(Boolean).join(' & ')
151151
}

tslint.json

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

0 commit comments

Comments
 (0)