xojs / gulp-xo Goto Github PK
View Code? Open in Web Editor NEWValidate files with XO
Home Page: https://github.com/xojs/xo
License: MIT License
Validate files with XO
Home Page: https://github.com/xojs/xo
License: MIT License
Hallo @sindresorhus!
I need a function to export results in file, in gulp-xo
there is no function. So, I created PR #12 to do this.
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.
Please bump XO version, it's outdated.
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"
}
]
}
}
]
}
}
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 :-
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
I'm using quiet: true
as single option for gulp-xo but it still prints [22:47:29] gulp-xo
plus an empty line for every linted file.
Is this the intented behavior or a bug?
> 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.
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!
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?
There's currently a bug on line 42-47 at https://github.com/xojs/gulp-xo/blob/master/index.js#L42-L47 where file.eslint
is undefined therefore file.eslint.output
will throw an error TypeError: Cannot read property 'output' of undefined
. This has happened to me on multiple occassions with files that do not have any eslint output.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.