Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plato is listing LintErrors not found with ESLint #211

Open
matteozambon89 opened this issue Jul 30, 2017 · 3 comments
Open

Plato is listing LintErrors not found with ESLint #211

matteozambon89 opened this issue Jul 30, 2017 · 3 comments

Comments

@matteozambon89
Copy link

My gulpfile.js

/**
 * @Author: Matteo Zambon <Matteo>
 * @Date:   2017-07-29 03:24:19
 * @Last modified by:   Matteo
 * @Last modified time: 2017-07-29 09:41:36
 */

const gulp = require('gulp')
const $ = require('gulp-load-plugins')()
const plato = require('plato')
const _ = require('lodash')

const paths = {
  'platoInput': [
    'index.js',
    'gulpfile.js',
    'config/*.js',
    'config/**/*.js',
    'api/*.js',
    'api/**/*.js'
  ],
  'platoOutput': './plato'
}

gulp.task('plato', () => {
  const asyncPipeOpts = {
    'oneTimeRun': true,
    'passThrough': true
  }

  function asyncPipeTask(opts, chunk, cb) {
    const platoOpts = {
      'jshint': null,
      'eslint': require('./.eslintrc.json')
    }
    function callback(report) {
      $.util.log('Report created!')

      cb()
    }

    plato.inspect(paths.platoInput, paths.platoOutput, platoOpts, callback)
  }

  function asyncPipeDone(errs, data) {
    _.each(errs, (err) => {
      if (err.message) {
        $.util.log('Error! ' + err.message)
      }
      else {
        $.util.log('Error!')
      }

      $.util.log(err)
    })
  }

  return gulp.src('./index.js')
    .pipe($.asyncFuncRunner(asyncPipeOpts, asyncPipeTask, asyncPipeDone))
})

This my .eslintrc.json

{
  "extends": "trails",
  "plugins": [
    "markdown",
    "json",
    "mocha"
  ],
  "globals": {
    "test": true
  },
  "rules": {
    "brace-style": [
      "warn",
      "stroustrup",
      {
        "allowSingleLine": true
      }
    ],
    "linebreak-style": [
      "error",
      "unix"
    ]
  }
}

some of the files are shows with 1 lint error but I don't understand which error is since ESLint doesn't show any

@unshame
Copy link

unshame commented Sep 10, 2017

I'm using JSHint and had a similar issue (all files showed up with 1 linting error) which I found out was caused by having my .jshintrc extend another one.
It seems like plato doesn't support linting config extending since the rules from the parent config weren't being applied to the code. Or maybe it can't find the parent config since it has a different working directory.

@andywillis
Copy link

@matteozambon89 @unshame I've found better success with https://github.com/the-simian/es6-plato.

@the-simian
Copy link
Collaborator

@matteozambon89 @unshame yeah I fixed this on my fork a while back... I was experiencing the same issue.

kyungilpark added a commit to kyungilpark/plato that referenced this issue Jun 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants