-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.eslintcache
1 lines (1 loc) · 10.2 KB
/
.eslintcache
1
[{"D:\\PL\\Project\\pl_project\\src\\index.js":"1","D:\\PL\\Project\\pl_project\\src\\reportWebVitals.js":"2","D:\\PL\\Project\\pl_project\\src\\App.js":"3","D:\\PL\\Project\\pl_project\\src\\DrawCanvas.js":"4","D:\\PL\\Project\\pl_project\\src\\BlocklyApp.js":"5","D:\\PL\\Project\\pl_project\\src\\customBlocks\\conditionals.js":"6","D:\\PL\\Project\\pl_project\\src\\customBlocks\\movement.js":"7","D:\\PL\\Project\\pl_project\\src\\customBlocks\\expressions.js":"8","D:\\PL\\Project\\pl_project\\src\\customBlocks\\variables.js":"9","D:\\PL\\Project\\pl_project\\src\\customBlocks\\operations.js":"10","D:\\PL\\Project\\pl_project\\src\\customBlocks\\logic.js":"11","D:\\PL\\Project\\pl_project\\src\\customBlocks\\loops.js":"12","D:\\PL\\Project\\pl_project\\src\\customBlocks\\shapes.js":"13"},{"size":500,"mtime":1651135676000,"results":"14","hashOfConfig":"15"},{"size":362,"mtime":1651135676000,"results":"16","hashOfConfig":"15"},{"size":1589,"mtime":1652162877574,"results":"17","hashOfConfig":"15"},{"size":3400,"mtime":1652163670164,"results":"18","hashOfConfig":"15"},{"size":5526,"mtime":1652163271973,"results":"19","hashOfConfig":"15"},{"size":4868,"mtime":1652166021111,"results":"20","hashOfConfig":"15"},{"size":4139,"mtime":1652167712040,"results":"21","hashOfConfig":"15"},{"size":1620,"mtime":1652119695981,"results":"22","hashOfConfig":"15"},{"size":2195,"mtime":1652119703660,"results":"23","hashOfConfig":"15"},{"size":5887,"mtime":1652165362552,"results":"24","hashOfConfig":"15"},{"size":7714,"mtime":1652119698690,"results":"25","hashOfConfig":"15"},{"size":3218,"mtime":1652166052322,"results":"26","hashOfConfig":"15"},{"size":4871,"mtime":1652163765680,"results":"27","hashOfConfig":"15"},{"filePath":"28","messages":"29","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"hxkhzg",{"filePath":"31","messages":"32","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"33","messages":"34","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"35","messages":"36","errorCount":0,"fatalErrorCount":0,"warningCount":9,"fixableErrorCount":0,"fixableWarningCount":0,"source":"37","usedDeprecatedRules":"30"},{"filePath":"38","messages":"39","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"40","messages":"41","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"42","messages":"43","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"44","messages":"45","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"46","messages":"47","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"48","messages":"49","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"50","messages":"51","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"52","messages":"53","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},{"filePath":"54","messages":"55","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"30"},"D:\\PL\\Project\\pl_project\\src\\index.js",[],["56","57"],"D:\\PL\\Project\\pl_project\\src\\reportWebVitals.js",[],"D:\\PL\\Project\\pl_project\\src\\App.js",[],"D:\\PL\\Project\\pl_project\\src\\DrawCanvas.js",["58","59","60","61","62","63","64","65","66"],"import React from \"react\";\r\n\r\nconst DrawCanvas = props => {\r\n const canvasRef = React.useRef(null);\r\n let { command, resetFn, ...rest} = props;\r\n const currCanvas = React.useRef(null);\r\n\r\n React.useEffect(() => {\r\n if (command.includes('while')) {\r\n if (!window.confirm('Are you sure all while loops are terminating?')) {\r\n command = 'Ensure all the blocks and statements are filled'\r\n }\r\n }\r\n if (command === 'Ensure all the blocks and statements are filled') {}\r\n else {\r\n const canvas = canvasRef.current;\r\n const context = canvas.getContext('2d');\r\n context.restore();\r\n context.clearRect(0, 0, canvas.width, canvas.height);\r\n context.save();\r\n context.translate(canvas.width / 2, canvas.height / 2);\r\n saveCanvasDrawing(context, canvas);\r\n try {\r\n eval(command); \r\n } catch (e) {\r\n if (e instanceof SyntaxError) {\r\n alert(e.message);\r\n } else { \r\n alert(e)\r\n }\r\n }\r\n }\r\n }, [command]);\r\n\r\n const saveCanvasDrawing = (context, canvas) => {\r\n currCanvas.current = context.getImageData(0, 0, canvas.width, canvas.height);\r\n }\r\n\r\n const loadCanvasDrawing = context => {\r\n context.putImageData(currCanvas.current, 0, 0);\r\n }\r\n\r\n const parseCmd = command => {\r\n let [dir, value] = command.split(\" \")\r\n let angle = 0\r\n let resultDir = \"\"\r\n value = Number(value)\r\n switch (dir.toUpperCase()) {\r\n case \"FD\":\r\n resultDir = \"FORWARD\"\r\n break\r\n case \"BK\":\r\n resultDir = \"BACKWARD\"\r\n angle = 180\r\n break\r\n case \"LT\":\r\n resultDir = \"LEFT\"\r\n angle = -value\r\n break\r\n case \"RT\":\r\n resultDir = \"RIGHT\"\r\n angle = value\r\n break\r\n }\r\n return {\r\n dir: resultDir,\r\n value,\r\n angle: deg2Rad(angle),\r\n }\r\n }\r\n\r\n const deg2Rad = deg => {\r\n return (deg * Math.PI) / 180\r\n }\r\n\r\n const drawTurtle = ctx => {\r\n const stroke = ctx.strokeStyle\r\n ctx.strokeStyle = \"rgb(0, 0, 0)\"\r\n ctx.beginPath()\r\n ctx.moveTo(-7, -7)\r\n ctx.lineTo(0, 7)\r\n ctx.lineTo(7, -7)\r\n ctx.closePath()\r\n ctx.stroke()\r\n ctx.strokeStyle = stroke\r\n }\r\n\r\n const sleep = (milliseconds) => {\r\n return new Promise(resolve => setTimeout(resolve, milliseconds))\r\n }\r\n\r\n const draw = (command, ctx) => {\r\n const { dir, angle, value } = parseCmd(command)\r\n console.log(dir, angle, value)\r\n ctx.rotate(angle)\r\n if (dir === \"FORWARD\" || dir === \"BACKWARD\") {\r\n ctx.beginPath()\r\n ctx.moveTo(0, 0)\r\n ctx.lineTo(0, value)\r\n ctx.translate(0, value)\r\n ctx.closePath()\r\n ctx.stroke()\r\n }\r\n }\r\n\r\n const pendown = (ctx) => {\r\n ctx.strokeStyle = \"rgb(0, 0, 0)\"\r\n }\r\n\r\n const penup = (ctx) => {\r\n ctx.strokeStyle = \"rgb(255, 255, 255)\"\r\n }\r\n\r\n return <canvas ref={canvasRef} {...rest} />\r\n}\r\n\r\nexport default DrawCanvas;","D:\\PL\\Project\\pl_project\\src\\BlocklyApp.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\conditionals.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\movement.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\expressions.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\variables.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\operations.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\logic.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\loops.js",[],"D:\\PL\\Project\\pl_project\\src\\customBlocks\\shapes.js",[],{"ruleId":"67","replacedBy":"68"},{"ruleId":"69","replacedBy":"70"},{"ruleId":"71","severity":1,"message":"72","line":11,"column":27,"nodeType":"73","endLine":11,"endColumn":76},{"ruleId":"74","severity":1,"message":"75","line":24,"column":17,"nodeType":"76","messageId":"77","endLine":24,"endColumn":21},{"ruleId":"78","severity":1,"message":"79","line":39,"column":11,"nodeType":"80","messageId":"81","endLine":39,"endColumn":28},{"ruleId":"82","severity":1,"message":"83","line":48,"column":9,"nodeType":"84","messageId":"85","endLine":64,"endColumn":10},{"ruleId":"78","severity":1,"message":"86","line":76,"column":11,"nodeType":"80","messageId":"81","endLine":76,"endColumn":21},{"ruleId":"78","severity":1,"message":"87","line":88,"column":11,"nodeType":"80","messageId":"81","endLine":88,"endColumn":16},{"ruleId":"78","severity":1,"message":"88","line":92,"column":11,"nodeType":"80","messageId":"81","endLine":92,"endColumn":15},{"ruleId":"78","severity":1,"message":"89","line":106,"column":11,"nodeType":"80","messageId":"81","endLine":106,"endColumn":18},{"ruleId":"78","severity":1,"message":"90","line":110,"column":11,"nodeType":"80","messageId":"81","endLine":110,"endColumn":16},"no-native-reassign",["91"],"no-negated-in-lhs",["92"],"react-hooks/exhaustive-deps","Assignments to the 'command' variable from inside React Hook React.useEffect will be lost after each render. To preserve the value over time, store it in a useRef Hook and keep the mutable value in the '.current' property. Otherwise, you can move this variable directly inside React.useEffect.","Literal","no-eval","eval can be harmful.","CallExpression","unexpected","no-unused-vars","'loadCanvasDrawing' is assigned a value but never used.","Identifier","unusedVar","default-case","Expected a default case.","SwitchStatement","missingDefaultCase","'drawTurtle' is assigned a value but never used.","'sleep' is assigned a value but never used.","'draw' is assigned a value but never used.","'pendown' is assigned a value but never used.","'penup' is assigned a value but never used.","no-global-assign","no-unsafe-negation"]