Skip to content

Commit 50dab80

Browse files
committed
fix lint
1 parent c960405 commit 50dab80

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

.eslintrc.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,21 @@
4949
}
5050
],
5151
"linebreak-style": ["error", "unix"]
52-
}
52+
},
53+
"overrides": [
54+
{
55+
"files": ["website/examples/**/*"],
56+
"rules": {
57+
"prettier/prettier": [
58+
"error",
59+
{
60+
"trailingComma": "all",
61+
"arrowParens": "always",
62+
"useTabs": false,
63+
"bracketSpacing": false
64+
}
65+
]
66+
}
67+
}
68+
]
5369
}

website/examples/minesweeper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
emport {jsx} from "@b9g/crank/standalone";
1+
import {jsx} from "@b9g/crank/standalone";
22
import {renderer} from "@b9g/crank/dom";
33

44
function Hexagon({cx = 0, cy = 0, r, ...props}) {

website/examples/xstate-calculator.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@ import {Machine, assign} from "xstate@4/dist/xstate.web.js";
66
import {Context, createElement} from "@b9g/crank";
77
import {renderer} from "@b9g/crank/dom";
88

9-
const not = (fn) => (...args) => !fn.apply(null, args);
9+
const not =
10+
(fn) =>
11+
(...args) =>
12+
!fn.apply(null, args);
1013
const isZero = (context, event) => event.key === 0;
1114
const isNotZero = not(isZero);
1215
const isMinus = (context, event) => event.operator === "-";
1316
const isNotMinus = not(isMinus);
14-
const divideByZero = (context) => context.operand2 === "0." && context.operator === "/";
17+
const divideByZero = (context) =>
18+
context.operand2 === "0." && context.operator === "/";
1519
const notDivideByZero = not(divideByZero);
1620

1721
function doMath(operand1, operand2, operator) {
@@ -421,7 +425,10 @@ function* Calculator(this: Context) {
421425
if (Number.isInteger(+label)) {
422426
state = calcMachine.transition(state, {type: "NUMBER", key: +label});
423427
} else if (isOperator(label)) {
424-
state = calcMachine.transition(state, {type: "OPERATOR", operator: label});
428+
state = calcMachine.transition(state, {
429+
type: "OPERATOR",
430+
operator: label,
431+
});
425432
} else if (label === "C") {
426433
state = calcMachine.transition(state, {type: "CLEAR_EVERYTHING"});
427434
} else if (label === ".") {

0 commit comments

Comments
 (0)