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.

Using src from the parent folder of gulpfile.js will not be linted

See original GitHub issue

For a Meteor project we have to keep the gulpfile.js and node_modules in a folder that is not visible to meteor otherwise it will compile them. This means putting gulpfile.js into a dot subfolder like .gulp which is what https://github.com/bbmoz/meteor-gulp/ does. The gulpfile it generates looks something like this.

https://github.com/bbmoz/meteor-gulp/blob/master/plugin/gulpfile.temp

Their example uses jshint and jscs but I’d rather use eslint because it’s a bit easier to configure for Angular and ES6. However when the ./../** ... globs get passed to eslint it does not get processed. I have verified that the files will match the glob if I use gulp-print to print out the file list. My current workaround is to reorganize the project such that gulpfile is in the parent folder and my meteor is in a sub folder.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
adametrycommented, Mar 16, 2016

Try adding warnFileIgnored:true to your gulp-eslint config. If you receive a bunch of ignore warnings let me know and I’ll dig into why the linter might give mixed messages (gulp-eslint uses eslint’s isPathIgnored to avoid linting .eslintignore’d files).

0reactions
shinnncommented, Jul 13, 2016
├ project (cwd)
│ ├ gulpfile.js
│ └ package.json 
│
└ script.js 

package.json:

{
  "name": "test",
  "private": true,
  "devDependencies": {
    "gulp": "gulpjs/gulp#d8f5c90a0622d19ef1943a2a3d02dc50e3c853e7",
    "gulp-eslint": "^3.0.1"
  }
}

gulpfile.js:

'use strict';
const gulp = require('gulp');
const eslint = require('gulp-eslint');

gulp.task('default', () => {
  return gulp.src('../script.js')
  .pipe(eslint({
    useEslintrc: false,
    rules: {
      camelcase: 'error'
    }
  }))
  .pipe(eslint.format());
});

script.js:

a_b = c
$ node -v
v6.3.0

$ npm -v
3.10.5

$ node node_modules/gulp/bin/gulp.js
[03:22:50] Using gulpfile ~/test/project/gulpfile.js
[03:22:50] Starting 'default'...
[03:22:50] 
/Users/Shinnosuke/test/script.js
  1:1  error  Identifier 'a_b' is not in camel case  camelcase

✖ 1 problem (1 error, 0 warnings)

[03:22:50] Finished 'default' after 75 ms

This issue seems to be fixed in the latest version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gulpfile not outputting to correct location - Stack Overflow
Anyway, I have a basic folder project with dist, src, node_modules, gulpfile.js and package.json. My main problem is that the outputted src/sass ...
Read more >
Getting Started with Gulp.js - Semaphore Tutorial
Learn how to set up and use Gulp.js, a task runner for Node.js based on Node streams. We'll introduce main concepts of Gulp...
Read more >
JavaScript and Gulpfiles - gulp.js
Gulp allows you to use existing JavaScript knowledge to write gulpfiles or to use ... A gulpfile is a file in your project...
Read more >
@jenkins-cd/js-builder - npm
The best place to learn how to use this utility as part of building Jenkins plugins is to see the Sample Plugins repository....
Read more >
CSS: Tools & Skills - Section 1 - SitePoint
In this article, we look at how you can use Gulp.js to automate a range of repetitive CSS ... Create a src/scss folder...
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