JSRocksHQ / harmonic

The next static site generator
http://harmonicjs.com/
MIT License
282 stars 26 forks source link

Lint errors #160

Closed viniciusdacal closed 9 years ago

viniciusdacal commented 9 years ago

I've got many lint errors trying to run npm run dev

/Users/viniciusdacal/github/harmonic/src/test/main.js
   44:8   error  Unexpected var, use let or const instead  no-var
   63:8   error  Unexpected var, use let or const instead  no-var
   74:8   error  Unexpected var, use let or const instead  no-var
   92:12  error  Unexpected var, use let or const instead  no-var
   97:20  error  Unexpected var, use let or const instead  no-var
  102:24  error  Unexpected var, use let or const instead  no-var
  120:8   error  Unexpected var, use let or const instead  no-var

/Users/viniciusdacal/github/harmonic/src/bin/config.js
  4:31  error  Use path.join() or path.resolve() instead of + to create paths  no-path-concat

/Users/viniciusdacal/github/harmonic/src/bin/core.js
   2:9   error  isHarmonicProject is defined but never used  no-unused-vars
  36:12  error  Unexpected trailing comma                    comma-dangle

/Users/viniciusdacal/github/harmonic/src/bin/helpers.js
  36:12  error  isHarmonicProject was used before it was defined  no-use-before-define

/Users/viniciusdacal/github/harmonic/src/bin/parser.js
   51:12  error  Identifier 'index_posts' is not in camel case   camelcase
   70:8   error  Expected { after 'if' condition                 curly
  186:8   error  Unexpected var, use let or const instead        no-var
  199:12  error  Unexpected var, use let or const instead        no-var
  259:21  error  Identifier 'default_lang' is not in camel case  camelcase
  305:12  error  Unexpected var, use let or const instead        no-var

/Users/viniciusdacal/github/harmonic/src/bin/cli/harmonic.js
  63:4  error  Don't use process.exit(); throw an error instead  no-process-exit

/Users/viniciusdacal/github/harmonic/src/bin/cli/logo.js
  4:0  error  Unexpected var, use let or const instead  no-var

/Users/viniciusdacal/github/harmonic/src/bin/cli/util.js
   41:10  error  config was used before it was defined              no-use-before-define
   87:16  error  Identifier 'posts_permalink' is not in camel case  camelcase
   88:16  error  Identifier 'pages_permalink' is not in camel case  camelcase
   89:16  error  Identifier 'header_tokens' is not in camel case    camelcase
   90:16  error  Identifier 'index_posts' is not in camel case      camelcase
   98:23  error  Unexpected prompt                                  no-alert
  101:18  error  config is already declared in the upper scope      no-shadow
  146:4   error  Unexpected var, use let or const instead           no-var

✖ 27 problems (27 errors, 0 warnings)

I'm going to fix and send a pull request.

jaydson commented 9 years ago

Hey @viniciusdacal, thanks for pointing this. As far as I know, we have this lint errors because we didn't fixed them when we introduce ESLint. Am I right @UltCombo ?

It'd be awesome if you can fix those lint errors @viniciusdacal

UltCombo commented 9 years ago

Thanks for working on this. =] I haven't prioritized "fixing" all these linting issues because some are actual errors, while others just need tweaking the .eslintrc settings or adding ignore comments on a case-by-case basis.

E.g., while no-process-exit is a good directive for the API part, in some parts of the CLI we'd rather log a descriptive error message and exit instead of throwing an error with useless clutter.