-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintcache
1 lines (1 loc) · 6.41 KB
/
.eslintcache
1
[{"/private/var/www/work/stopwatch/src/index.js":"1","/private/var/www/work/stopwatch/src/reportWebVitals.js":"2","/private/var/www/work/stopwatch/src/App.js":"3","/private/var/www/work/stopwatch/src/stopWatch/stopWatch.js":"4"},{"size":500,"mtime":1608715896987,"results":"5","hashOfConfig":"6"},{"size":362,"mtime":1608715896989,"results":"7","hashOfConfig":"6"},{"size":180,"mtime":1608715896982,"results":"8","hashOfConfig":"6"},{"size":4138,"mtime":1608715896994,"results":"9","hashOfConfig":"6"},{"filePath":"10","messages":"11","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},"3z9v3t",{"filePath":"13","messages":"14","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},{"filePath":"15","messages":"16","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"12"},{"filePath":"17","messages":"18","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"19"},"/private/var/www/work/stopwatch/src/index.js",[],["20","21"],"/private/var/www/work/stopwatch/src/reportWebVitals.js",[],"/private/var/www/work/stopwatch/src/App.js",[],"/private/var/www/work/stopwatch/src/stopWatch/stopWatch.js",["22","23","24","25","26","27"],"import React, { Component, Fragment } from 'react'\nimport './stopWatch.css'\n\nexport default class stopWatch extends Component {\n constructor(props) {\n super(props);\n this.state = {\n timer: '', milisec: 0, sec: 0, min: 0, hour: 0, miliSecOut: 0, secOut: 0, minOut: 0, hourOut: 0, startstop: 0, noOfLaps: 0\n }\n this.startStopCounter = this.startStopCounter.bind(this)\n this.startCounter = this.startCounter.bind(this)\n this.stopCounter = this.stopCounter.bind(this)\n this.counter = this.counter.bind(this)\n this.checkTime = this.checkTime.bind(this)\n this.createLaps = this.createLaps.bind(this)\n this.resetCounter = this.resetCounter.bind(this)\n this.detectSpacePressed = this.detectSpacePressed.bind(this)\n }\n\n startStopCounter() {\n this.state.startstop = this.state.startstop + 1;\n if (this.state.startstop === 1) {\n this.startCounter();\n document.getElementById(\"start\").innerHTML = \"Stop\";\n } else if (this.state.startstop === 2) {\n document.getElementById(\"start\").innerHTML = \"Start\";\n this.setState({\n startstop: 0\n })\n this.stopCounter();\n }\n }\n\n startCounter() {\n this.setState({\n timer: setInterval(this.counter, 10)\n })\n }\n\n stopCounter() {\n clearInterval(this.state.timer);\n }\n\n counter() {\n this.setState({\n miliSecOut: this.checkTime(this.state.milisec),\n secOut: this.checkTime(this.state.sec),\n minOut: this.checkTime(this.state.min),\n hourOut: this.checkTime(this.state.hour),\n milisec: ++this.state.milisec\n })\n if (this.state.milisec === 100) {\n this.setState({\n milisec: 0,\n sec: ++this.state.sec\n })\n }\n if (this.state.sec === 60) {\n this.setState({\n sec: 0,\n min: ++this.state.min\n })\n }\n if (this.state.min === 60) {\n this.setState({\n min: 0,\n hour: ++this.state.hour\n })\n }\n\n document.getElementById(\"hour\").innerHTML = this.state.hourOut;\n document.getElementById(\"min\").innerHTML = this.state.minOut;\n document.getElementById(\"sec\").innerHTML = this.state.secOut;\n document.getElementById(\"milisec\").innerHTML = this.state.miliSecOut;\n }\n\n checkTime(inc) {\n if (inc < 10) {\n inc = \"0\" + inc;\n }\n return inc;\n }\n createLaps() {\n this.state.noOfLaps = this.state.noOfLaps + 1\n let lapsData = document.createElement('div');\n lapsData.innerHTML = `<span>${this.state.noOfLaps} Lap</span> <span>${this.state.hour}</span> <span>${this.state.min}</span> <span>${this.state.sec}</span> <span>${this.state.milisec}</span>`;\n document.getElementsByClassName('laps-wrapper')[0].appendChild(lapsData);\n }\n\n resetCounter() {\n this.setState({\n hour: 0, min: 0, sec: 0, milisec: 0\n })\n document.getElementById(\"milisec\").innerHTML = \"00\";\n document.getElementById(\"sec\").innerHTML = \"00\";\n document.getElementById(\"min\").innerHTML = \"00\";\n document.getElementById(\"hour\").innerHTML = \"00\";\n }\n\n detectSpacePressed = (e) => {\n if (e.keyCode === 32) {\n console.log('i');\n }\n }\n render() {\n return (\n <Fragment>\n <header><h1>React StopWatch</h1></header>\n <div className='stopwatch-wrapper'>\n <div className=\"stopwatch-container\">\n <div className=\"stopwatch\">\n <span id=\"hour\">00</span> : <span id=\"min\">00</span> : <span id=\"sec\">00</span> : <span id=\"milisec\">00</span>\n </div>\n <button onClick={this.startStopCounter} id=\"start\">Start</button>\n <button onClick={this.createLaps} id=\"lap\" onKeyPress={this.detectSpacePressed}>Lap</button>\n <button onClick={this.resetCounter}>Reset</button>\n </div>\n <div className=\"laps-wrapper\">\n <div><span>Laps Count</span><span>Hours</span><span>Mins</span><span>Sec</span><span>Millisec</span></div>\n </div>\n </div>\n <footer>Design & Developed by <a href=\"https://voletiswaroop.github.io/\" rel=\"noreferrer\" title=\"Swaroop Voleti portfolio\" target=\"_blank\">Swaroop Voleti</a>\n </footer>\n </Fragment>\n )\n }\n}",{"ruleId":"28","replacedBy":"29"},{"ruleId":"30","replacedBy":"31"},{"ruleId":"32","severity":1,"message":"33","line":21,"column":5,"nodeType":"34","endLine":21,"endColumn":15},{"ruleId":"32","severity":1,"message":"33","line":50,"column":18,"nodeType":"34","endLine":50,"endColumn":28},{"ruleId":"32","severity":1,"message":"33","line":55,"column":16,"nodeType":"34","endLine":55,"endColumn":26},{"ruleId":"32","severity":1,"message":"33","line":61,"column":16,"nodeType":"34","endLine":61,"endColumn":26},{"ruleId":"32","severity":1,"message":"33","line":67,"column":17,"nodeType":"34","endLine":67,"endColumn":27},{"ruleId":"32","severity":1,"message":"33","line":84,"column":5,"nodeType":"34","endLine":84,"endColumn":15},"no-native-reassign",["35"],"no-negated-in-lhs",["36"],"react/no-direct-mutation-state","Do not mutate state directly. Use setState().","MemberExpression","no-global-assign","no-unsafe-negation"]