Refactor de código para utilizar el módulo TVMaze
Clase 27 de 38 • Curso Profesional de Node.js y JavaScript 2015
Contenido del curso
Clase 27 de 38 • Curso Profesional de Node.js y JavaScript 2015
Contenido del curso
José Alejandro Muñoz Ruiz
David Daza
Belen Gudiño
Joel Gonzales Tipismana
Consulta:
Porque standar me reclama por el codigo generado por babel a traves del script "dist"
"scripts": { "public": "mkdir -p public", "lint": "standard", "build-js": "NODE_PATH=. browserify -t [ babelify --presets [ es2015 ] ] src/client/index.js > public/app.js", "copy-files": "cp src/client/index.css public/app.css && cp src/client/index.html public/index.html", "build": "npm run public && npm run build-js && npm run copy-files", "dist": "babel src/server/index.js src/server/**/*.js --out-dir dist --presets es2015", "serve": "NODE_PATH=./dist node dist/src/server", "start": "npm run lint && npm run dist && npm run build && npm run serve" }
me lanza este tipo de errores el modulo "Standard"
standard: Use JavaScript Standard Style () /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:1:13: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:3:32: Strings must use singlequote. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:5:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:7:34: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:9:49: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:11:33: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:13:47: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:15:43: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:17:47: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:19:32: Missing space before function parentheses. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:19:93: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:21:40: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:22:45: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:27:43: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:30:20: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:31:5: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:32:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:36:28: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:39:43: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:41:19: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:42:5: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:43:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:47:31: Missing space before function parentheses. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:50:45: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:52:21: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:53:6: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:54:4: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:56:25: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:61:32: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:62:28: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:65:31: A constructor name should not start with a lowercase letter. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:65:40: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:66:23: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:67:21: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:68:30: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:70:5: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:71:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:73:2: Newline required at end of file but not found. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/api/index.js:73:25: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:1:13: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:3:34: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:5:49: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:7:37: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:9:41: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:11:36: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:13:51: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:15:32: Missing space before function parentheses. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:15:93: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:17:35: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:19:84: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:21:44: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:24:30: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:25:9: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:26:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:29:30: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:30:9: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:31:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:33:31: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:36:54: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:37:2: Newline required at end of file but not found. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/index.js:37:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:1:13: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:3:32: Strings must use singlequote. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:5:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:7:36: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:9:51: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:11:32: Missing space before function parentheses. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:11:93: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:16:3: Extra semicolon. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:18:2: Newline required at end of file but not found. /home/jmunoz/Documentos/Platzi/Cursos/Javascript y Nodejs/tvify/dist/src/server/models/index.js:18:63: Extra semicolon.
No sé si ya le diste solución, pero al parecer finalizas las sentencias con punto y coma. Al utilizar standard no es necesario hacerlo
"serve": "NODE_PATH=./dist node dist/src/server"
alguien me puede ayudar como ident esta linea para windows ya que windows no reconoce NODE_PATH
lo más rapido que hice fue quitarlo y determinar una ruta especifica a partir del index.js del server, no se si encontraste otra solucion?, de paso tuviste algun error con istanbul para ver el progreso del test?? pd: "hay un dolor duro en windows T_T, pero a darle con lo que hay ;) "