Giter Site home page Giter Site logo

gulp-xo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

gulp-xo's Issues

Ignores fail when used in a subdirectory

First of all, thanks for all your hard work on this! I really appreciate it.
I'm having a problem where gulp-xo seems to fail when dealing with ignores that have a subfolder.
Example:

//Doesn't work.
"ignores": [
  "src/vendor/**"
]
//Works.
"ignores": [
  "vendor/**"
]

The regular xo tool works fine, ignoring the files and continuing on.
On the other hand, the gulp-xo tool will still check these files.

Those pictures were both taken, one after the other, in the same development enviroment.

Gulpfile:

const gulp = require('gulp');
const xo = require('gulp-xo');

gulp.task('xo', function () {
    return gulp.src('src/**/*.js')
    .pipe(xo())
    .pipe(gulp.dest('.tmp'));
});

package.json:

"xo": {
    "envs": [
      "browser"
    ],
    "globals": [
      "angular",
      "_"
    ],
    "ignores": [
      "gulp_tasks/**",
      "conf/**",
      "src/vendor/**"
    ]
  }

I'm sorry if I missed something obvious about gulp-xo and the difference from xo.

Thanks for your work on this project and other projects.

doesn't work overrides options

Hi. thank you for your helpful plugin ๐Ÿ˜„

npm run xo: overrides works fine.
gulp xo: ignores overrides options.

I wonder that xo.lintText doesn't care overrides's files
https://github.com/sindresorhus/xo/blob/master/index.js#L7

{
  "scripts": {
    "xo": "xo src/**/*.js",
  },
  "xo": {
    "extends": "xo-react",
    "plugins": [
      "react"
    ],
    "overrides": [
      {
        "files": "src/Components/**/*.js",
        "rules": {
          "xo/filename-case": [
            "error",
            {
              "case": "pascalCase"
            }
          ]
        }
      }
    ]
  }
}

While using spaces:true , Expected indentation of 1 tab character but found 0.

Hi,

I am using gulp-xo with following code in my gulpfile.js

gulp.task('xo', function () {
  return gulp.src('*.js')
              .pipe(xo({
                spaces: true
              }));
});

Since i have set spaces:true it should set indentation to 2 spaces for checking but when i run this task it throws errors that it expected 1 tab but found 0. as below :-

image

Continue checking files if one fails

Hi

I've got the following lint task in my gulp file:

gulp.task('lint', function () {
  return gulp.src(['./*.js', '!./bundle.js', './scripts/utils/**.js'])
    .pipe(xo())
    .pipe(gulp.dest('dest'));
});

However if there's lint errors on app.js it quits after reporting the error and doesn't continue to report issues with other files e.g index.js, gulpfile.js. Is there a way around it?

Thanks

Ben

Failed to load config "xo/esnext" to extend from.

> gulp xo

[08:28:52] Using gulpfile ~/git/whmcs-ispapi-domainchecker/gulpfile.js
[08:28:52] Starting 'xo'...
[08:28:52] 'xo' errored after 46 ms
[08:28:52] Error in plugin "gulp-xo"
Message:
    Failed to load config "xo/esnext" to extend from.
Referenced from: BaseConfig
Details:
    messageTemplate: extend-config-missing
    messageData: [object Object]
    fileName: /home/ad.ks.de/kschwarz/git/whmcs-ispapi-domainchecker/gulpfile.js
    domainEmitter: [object Object]
    domainThrown: false

where > npx xo works just perfectly fine.

reproduce by

git clone https://github.com/hexonet/whmcs-ispapi-domainchecker.git
npm i
gulp xo

Gulp's xo task: https://github.com/hexonet/whmcs-ispapi-domainchecker/blob/master/gulpfile.js#L43-L48
NOTE: I also tried providing a configuration to xo in the task, which did not improve the situation.

xo's configuration: https://github.com/hexonet/whmcs-ispapi-domainchecker/blob/master/package.json#L42-L54
NOTE: I had this also separated as configuration file, which did not improve the situation.

xo works fine with prettier together, just no idea why gulp-xo runs into trouble. thanks for your help, very appreciated.

Unable to resolve paths

Hi there!

I'm hopeful someone might be able to identify the cause of the problem I'm having. Given:

const lint = function () {
    return gulp.src('src/index.js')
            .pipe(xo());
};

Which results in:

/usr/src/app/index.js
  1:26  error  Unable to resolve path to module './js/server'  import/no-unresolved

You'll notice that the path to index.js is no longer src/index.js, but rather app/index.js. This is also the case if I gulp.src(path.resolve(__dirname, 'src/index.js')). So I'm curious about why gulp-xo (or vinyl somewhere along the way) is altering these paths, especially given that running xo cli works just fine.

Thanks!

Compact output

xo provides a compact option when running on the CLI. Is it possible to use the compact output for gulp-xo somehow, as an option maybe?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.