question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No output (if files to be linted is not in the same folder – or subfolder – as gulp)

See original GitHub issue

Hi,

I’ve probably done a really basic mistake somewhere. But I’ve been trying gulp-eslint to output errors for the last 2 hours. Feel free to tell me to continue with my day job and to stop pursuing ever working with code of any form, but I’m lost. Any guidance is appreciated.

Cheers!

gulpfile.js

'use strict';

var gulp      = require('gulp'),
    config    = require('./config.json'),
    functions = require('./functions.js'),
    plugins   = require('gulp-load-plugins')();

gulp.task( 'js:lint', functions.getTask('js-eslint', gulp, config, plugins) );

config.json

{
    ...
    "esLint": {
        "rules": {
            "camelcase": 2,
            "curly": 2,
            "brace-style": [2, "1tbs"],
            "quotes": [2, "single"],
            "semi": [2, "always"],
            "space-in-brackets": [2, "never"],
            "space-infix-ops": 2
        }
    }
}

gulp_task/js-lint.js

module.exports = function( gulp, config, plugins, functions ) {
    'use strict';

    var source = [
            config.src.js + 'test.js'
        ];

    return function() {
        gulp.src( source )
        .pipe( plugins.eslint({
            config: config.esLint
        }))
        .pipe( plugins.eslint.format() )
        .pipe( plugins.eslint.failAfterError() )
        .pipe( functions.onSuccess(plugins, 'JS:lint', 'Lint finished running') );
    };
};

test.js – Snatched from http://eslint.org/docs/rules/camelcase

var my_favorite_color = "#112C85";

function do_something() {
    // ...
}

obj.do_something = function() {
    // ...
};

var obj = {
    my_pref: 1
};

output

WalkPro:gulp Walker$ gulp js:lint
[14:41:36] Using gulpfile ~/Sites/_tmp/gulp/test/gulpfile.js
[14:41:36] Starting 'js:lint'...
[14:41:36] Finished 'js:lint' after 251 ms
[14:41:36] gulp-notify: [Success JS:lint] Success: Lint finished running

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
shinnncommented, Jul 13, 2016

This issue is fixed. evidence

0reactions
makky3939commented, Mar 22, 2016

I tried v1.1.1. It working. (This is a temporary way.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gulp - compile scss files in subfolders - Stack Overflow
I want to basically made possible to run gulp on BASE folder and watch and compile all .scss files separately in all scss...
Read more >
Move or copy an item to another folder - Microsoft Support
Learn how to copy an email message from one folder to another. ... If the folder you want to move or copy the...
Read more >
gulp-eslint-new - npm
Start using gulp-eslint-new in your project by running `npm i ... The location of the files to be linted is not related to...
Read more >
Multi-root Workspaces in Visual Studio Code
You can open and work on multiple project folders in Visual Studio Code with multi-root workspaces.
Read more >
ESLint | IntelliJ IDEA Documentation - JetBrains
If no .eslintrc.* is found in the current file folder, IntelliJ IDEA will look for one in its parent folders up to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found