Skip to content

Commit

Permalink
fix: delete lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
corners2wall committed Nov 9, 2023
1 parent 7c1d1f2 commit b2652f5
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 60 deletions.
33 changes: 27 additions & 6 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"root": true,
"plugins": ["@typescript-eslint", "prettier", "perfectionist"],
"plugins": [
"@typescript-eslint",
"prettier",
"perfectionist"
],
"extends": [
"eslint:recommended",
"airbnb-base",
Expand All @@ -18,7 +22,7 @@
"ecmaVersion": "latest",
"sourceType": "module",
"project": "./tsconfig.json",
"parser": "@typescript-eslint/parser"
"parser": "@typescript-eslint/parser"
},
"rules": {
"prettier/prettier": "error",
Expand All @@ -32,16 +36,33 @@
"react",
"nanostores",
"side-effect",
["builtin", "external"],
[
"builtin",
"external"
],
"internal-type",
"internal",
["parent-type", "sibling-type", "index-type"],
["parent", "sibling", "index"],
[
"parent-type",
"sibling-type",
"index-type"
],
[
"parent",
"sibling",
"index"
],
"style",
"object",
"unknown"
]
}
],
"@typescript-eslint/no-explicit-any": [
"error",
{
"ignoreRestArgs": true
}
]
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-react": "^7.33.2",
"prettier": "3.0.3",
"stats.js": "^0.17.0",
"typescript": "^5.0.2",
"vite": "^4.5.0"
},
Expand All @@ -34,6 +33,7 @@
"cannon-es": "^0.20.0",
"inversify": "^6.0.2",
"reflect-metadata": "^0.1.13",
"stats.js": "^0.17.0",
"rxjs": "^7.8.1",
"three": "^0.157.0"
}
Expand Down
4 changes: 2 additions & 2 deletions src/Components/Block/Block.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Quaternion, Vec3 } from 'cannon-es'
import { injectable } from 'inversify'

import { Positions } from '../../Types/common'
import { Positions, GameBlock } from '../../Types/common'
import PhysicBlock from './PhysicBlock'
import UiBlock from './UiBlock'

@injectable()
export default class Block {
export default class Block implements GameBlock {
protected uiBlock: UiBlock

protected physicBlock: PhysicBlock
Expand Down
46 changes: 0 additions & 46 deletions src/Components/Sound.ts

This file was deleted.

6 changes: 3 additions & 3 deletions src/Types/common.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { Broadphase, Solver, Vec3 } from 'cannon-es'
import { interfaces } from 'inversify'

import GameBlock from '../Components/Block/Block'

export interface Line {
start: number
end: number
Expand Down Expand Up @@ -39,12 +37,14 @@ export interface WorldOptions {

export type MapKey = string | number | symbol

export interface GameBlock {}

export interface GameBlockAdapter {
addGameBlock(block: GameBlock): void
removeGameBlock(block: GameBlock): void
}

export type AnyFunction = (...args: any[]) => any
export type AnyFunction = (...args: any[]) => unknown

export type Factory<
T,
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/EventEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class EventEmitter<Events extends MapKey = MapKey> {
;(this.get(eventType) || []).filter((callback) => callback !== listener)
}

emit(eventType: Events, ...data: any) {
emit(eventType: Events, ...data: any[]) {
const callbacks = this.get(eventType) || []

callbacks.forEach((callback) => callback(...data))
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class Observer<T> {
}

unsubscribe(observer: Observable<T>) {
this.observables = this.observables.filter((o) => o != observer)
this.observables = this.observables.filter((o) => o !== observer)
}

notify(data: T) {
Expand Down

0 comments on commit b2652f5

Please sign in to comment.