A
A
ayapergenov2016-01-19 14:21:42
JavaScript
ayapergenov, 2016-01-19 14:21:42

What to do with errors found through Gulp?

I'm learning Gulp.
I want to bind the timeline plugin to the project .
After adding any js files and running gulp I get a bunch of errors. When I connected all the files, I got more than 100,000 detected errors. To determine the cause, I disabled all scripts and left only main.js as a result of 15 errors. It contains a small script.

$(document).ready(function () { 
      var tg1 = $("#placement").timeline({
         "data_source":"json_tests/js_history.json",
         "min_zoom":15,
         "max_zoom":60, 
     });
   });

Here is the message from the terminal:
/home/roman/allApps/03.0_GULP/generator-gulp-webapp/app/scripts/main.js
  1:0   error  "$" is not defined                                no-undef
  1:18  error  Missing "use strict" statement                    strict
  1:32  error  Trailing spaces not allowed                       no-trailing-spaces
  2:10  error  tg1 is defined but never used                     no-unused-vars
  2:16  error  "$" is not defined                                no-undef
  2:18  error  Strings must use singlequote                      quotes
  3:9   error  Strings must use singlequote                      quotes
  3:23  error  Strings must use singlequote                      quotes
  3:23  error  Missing space before value for key "data_source"  key-spacing
  4:9   error  Strings must use singlequote                      quotes
  4:20  error  Missing space before value for key "min_zoom"     key-spacing
  5:9   error  Strings must use singlequote                      quotes
  5:20  error  Missing space before value for key "max_zoom"     key-spacing
  5:22  error  Unexpected trailing comma                         comma-dangle
  5:24  error  Trailing spaces not allowed                       no-trailing-spaces

✖ 15 problems (15 errors, 0 warnings)

[17:10:33] 'lint' errored after 948 ms
[17:10:33] ESLintError in plugin 'gulp-eslint'
Message:
    Failed with 15 errors

Perhaps ESLintError is too picky or I'm somehow not connecting the scripts in the right way.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2016-01-19
Protko @Fesor

correct the mistakes. Write in the eslint settings the global variables that you use ($). Replace the quotes as specified in the eslint settings, etc.
If you don't care about coding style, just disable eslint. In general, most of these problems can be fixed automatically (from version 2.0.0 of eslint or by means of the IDE + editorconfig).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question