viernes, 29 de julio de 2016

Simple solution for simple error


The most interesting thing in the software develop is the ease with which error occurs. In some
occasion the error is for a bad code, other because the person forgot programing some exception and in stranger case the cause is stranger
In some moment of this two weeks I discover the cause of a stranger error in a gulp task. But, before to explain the error and the steps to resolve this I explain you how is a gulp


Gulp

Gulp is a JavaScript task runner La principal idea of it is that you can programing a predefined task, for example:

  • Insert the localization of important files in the index.
  • Review the syntax of the program
  • Start a server to run an application.

The mysterious error in a gulp task

The first time that I execute the gulp task I found an interesting error in the console when the task for the review of the syntax has executed




The information of the error is very simple but no have sense. I discovered that my project not have an important file for the task: .jscsrc. If you search in Google this file you discover that is a file configuration with rules for the syntax. This file you can created yourself or use a predefine rules.

Resolve the error

So, you need file. How create this files? Simple, you need to follow the next steps:
1. Install this package npm install jscs –g
2. Run this command to generate JSCS configuration jscs --auto-configure path. Where path is the folder of you have the scripts.
3. When the command finally, you see something that it :

The number are the type of rules that you can choose. In the case for my project I use grunt, but you can use anything. When you choose the best option for you, the console inform that you have a .jscsrc file create.

If you run again your task, it have to works. This technique is utile if your report of error is different of the report of other members in your team, because it update de .jscs file.

No hay comentarios:

Publicar un comentario