diff --git a/.gitignore b/.gitignore index bc6a21516..3c67ead47 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,8 @@ tests/index.js app.yaml yarn-error.log +.eslintcache + # IntelliJ .idea/ diff --git a/package.json b/package.json index 2a4fdd3c5..b1852a888 100644 --- a/package.json +++ b/package.json @@ -15,8 +15,8 @@ "build:jsdocs": "node ./build/scripts/docs/index.js", "test": "node ./build/scripts/test.js", "coverage": "node ./build/scripts/test.js --coverage", - "lint": "eslint .", - "lint:fix": "eslint . --fix", + "lint": "eslint . --cache", + "lint:fix": "eslint . --fix --cache", "postinstall": "tsc --project ./scripts/tsconfig.json && copyfiles ./scripts/utils/browser/openChrome.applescript ./build" }, "devDependencies": { diff --git a/src/app/core/tools/WiringTool.ts b/src/app/core/tools/WiringTool.ts index 8a8bdfaca..40dcd7160 100644 --- a/src/app/core/tools/WiringTool.ts +++ b/src/app/core/tools/WiringTool.ts @@ -12,9 +12,9 @@ import {Port, Wire} from "core/models"; export const WiringTool = (() => { - enum StateType { - CLICKED, - DRAGGED, + const enum StateType { + Clicked, + Dragged, } let port: Port; @@ -84,8 +84,8 @@ export const WiringTool = (() => { // 2) if the port was initial dragged on, // then letting go of the mouse will deactivate this // 3) the user cancels using Escape, Backspace or RMB - return (stateType === StateType.CLICKED && event.type === "click") || - (stateType === StateType.DRAGGED && event.type === "mouseup") || + return (stateType === StateType.Clicked && event.type === "click") || + (stateType === StateType.Dragged && event.type === "mouseup") || (event.type === "keydown" && event.key === "Escape") || (event.type === "keydown" && event.key === "Backspace") || (event.type === "mousedown" && event.button === RIGHT_MOUSE_BUTTON); @@ -100,7 +100,7 @@ export const WiringTool = (() => { wire = info.designer.createWire(port, undefined); setWirePoint(port.getWorldTargetPos()); - stateType = (event.type === "click" ? StateType.CLICKED : StateType.DRAGGED); + stateType = (event.type === "click" ? StateType.Clicked : StateType.Dragged); }, onDeactivate({}: Event, info: CircuitInfo): void { const { history, designer } = info; diff --git a/src/site/pages/digital/src/utils/DigitalCreate.ts b/src/site/pages/digital/src/utils/DigitalCreate.ts index 23e489a7f..bb37537f9 100644 --- a/src/site/pages/digital/src/utils/DigitalCreate.ts +++ b/src/site/pages/digital/src/utils/DigitalCreate.ts @@ -75,7 +75,7 @@ export function DigitalCreateN(pos: Vector, itemId: string, designer: DigitalCir } -export enum SmartPlaceOptions { +export const enum SmartPlaceOptions { Off = 0, Inputs = 1 << 0, Outputs = 1 << 1,