Skip to content

Commit d44b5d3

Browse files
committed
feat: :sparkle added codemirror addons
1 parent 1b20f9f commit d44b5d3

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

.eslintrc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ module.exports = {
2727
"no-param-reassign": ["error", { props: false }],
2828
camelcase: "off",
2929
"linebreak-style": 0,
30-
"prettier/prettier": "error",
30+
"prettier/prettier": [
31+
"error",
32+
{
33+
endOfLine: "auto",
34+
},
35+
],
3136
},
3237
settings: {
3338
react: {

src/Cell.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ import roll from "./static/rolling.svg";
2727
require("codemirror/lib/codemirror.css");
2828
require("codemirror/mode/javascript/javascript");
2929
require("codemirror/theme/yeti.css");
30+
require("codemirror/addon/edit/closebrackets");
31+
require("codemirror/addon/edit/matchbrackets");
32+
require("codemirror/addon/hint/javascript-hint");
33+
require("codemirror/addon/hint/show-hint");
3034

3135
export default function Cell({
3236
cell,
@@ -40,7 +44,6 @@ export default function Cell({
4044
const refOutput = useRef("");
4145
const [showMoreCellButton, setShowMoreCellButton] = useState("none");
4246
useEffect(() => {
43-
console.log("hello");
4447
if (currentCell === cellId) {
4548
setShowMoreCellButton("flex");
4649
} else {
@@ -49,7 +52,6 @@ export default function Cell({
4952
}, [cellId, currentCell]);
5053
// eslint-disable-next-line consistent-return
5154
const getCode = async () => {
52-
console.log("oops");
5355
window.current_cell = cellId;
5456
if (cell.type === "code") {
5557
const input = refCode.current.getCodeMirror().getValue();
@@ -80,11 +82,7 @@ export default function Cell({
8082
}
8183
}
8284
}
83-
if (
84-
input.includes("table") ||
85-
input.includes("plot") ||
86-
input.includes("console.log(")
87-
) {
85+
if (input.includes("table") || input.includes("plot")) {
8886
// eslint-disable-next-line no-eval
8987
const id = `out_${window.current_cell}`;
9088
return false;

0 commit comments

Comments
 (0)