Skip to content

Commit be78594

Browse files
authoredJan 5, 2024
refactor: remove ts errors (#51)
1 parent 80495a1 commit be78594

File tree

8 files changed

+12
-5
lines changed

8 files changed

+12
-5
lines changed
 

‎.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.eslintrc.cjs
22
vite.config.ts
3-
bun.lockb
3+
bun.lockb
4+
dist

‎.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
. "$(dirname -- "$0")/_/husky.sh"
33

44
bun lint-staged
5+
bun quality

‎lint-staged.config.cjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
'*.{j,t}s': ['eslint --fix', 'prettier --write --ignore-unknown'],
2+
'*.ts': ['bun prettify'],
33
};

‎package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
"start": "bun run src/index.ts",
77
"commit": "cz",
88
"lint": "eslint . --fix --ext .ts",
9+
"ts:check": "tsc",
10+
"clean": "rm -rf dist",
11+
"prettify": "npx prettier . --write --ignore-unknown",
12+
"quality": "bun ts:check && bun clean && bun lint",
913
"test": "bun vitest run",
1014
"test:watch": "bun vitest",
11-
"prettify": "npx prettier . --write --ignore-unknown",
1215
"prepare": "husky install"
1316
},
1417
"devDependencies": {

‎src/data-structures/hash-map/hash-map.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ export class HashMap<K = any, V = any> {
167167
has(key: K) {
168168
const bucket = this.#findBucketByKey(key);
169169

170-
const node = bucket.find((pair) => pair.key === key);
170+
const node = bucket?.find((pair) => pair.key === key);
171171

172172
return Boolean(node);
173173
}

‎src/data-structures/stack/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './stack';

‎src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export * from './data-structures/hash-map';
33
export * from './data-structures/linked-list';
44
export * from './data-structures/lru-cache';
55
export * from './data-structures/queue';
6-
export * from './data-structures/tree/binary-tree-node';
6+
export * from './data-structures/stack';

‎tsconfig.custom.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"compilerOptions": {
3+
"outDir": "dist",
34
"baseUrl": ".",
45
"paths": {
56
"@/*": ["./src/*"]

0 commit comments

Comments
 (0)
Please sign in to comment.