Skip to content

Commit

Permalink
Merge pull request #1114 from OpenCircuits/eslint-cache-const-enum
Browse files Browse the repository at this point in the history
Add eslint cache
  • Loading branch information
LeonMontealegre committed Feb 6, 2024
2 parents eece31f + 09ebb0d commit b8b6bfe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -23,6 +23,8 @@ tests/index.js
app.yaml
yarn-error.log

.eslintcache

# IntelliJ
.idea/

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -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": {
Expand Down
12 changes: 6 additions & 6 deletions src/app/core/tools/WiringTool.ts
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/site/pages/digital/src/utils/DigitalCreate.ts
Expand Up @@ -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,
Expand Down

0 comments on commit b8b6bfe

Please sign in to comment.