Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Check JavaScript code style with JSCS
Issues with the output should be reported on the JSCS issue tracker.
$ npm install --save-dev gulp-jscs
const gulp = require('gulp');
const jscs = require('gulp-jscs');
gulp.task('default', () => {
return gulp.src('src/app.js')
.pipe(jscs())
.pipe(jscs.reporter());
});
const gulp = require('gulp');
const jscs = require('gulp-jscs');
gulp.task('default', () => {
return gulp.src('src/app.js')
.pipe(jscs({fix: true}))
.pipe(gulp.dest('src'));
});
const gulp = require('gulp');
const jscs = require('gulp-jscs');
gulp.task('default', () => {
return gulp.src('src/app.js')
.pipe(jscs({fix: true}))
.pipe(jscs.reporter())
.pipe(jscs.reporter('fail'))
.pipe(gulp.dest('src'));
});
A jscs
object will be attached to the file object.
An example with one error might look like this:
{
success: false, // or true if no errors
errorCount: 1, // number of errors in the errors array
errors: [{ // an array of jscs error objects
filename: 'index.js', // basename of the file
rule: 'requireCamelCaseOrUpperCaseIdentifiers', // the rule which triggered the error
message: 'All identifiers must be camelCase or UPPER_CASE', // error message
line: 32, // error line number
column: 7 // error column
}]
};
JSCS config should be placed in a .jscsrc
file.
Type: boolean
Default: false
Make JSCS attempt to auto-fix your files.
Be sure to pipe to gulp.dest
if you use this option.
Type: string
Default: JSCS will search for the config file up to your home directory.
Set the path to the JSCS config file.
Only use this option when it can't be found automatically.
Type: string
Default: console
See the JSCS reporter docs for supported input.
Can be used multiple times in the same pipeline.
This plugin also ships with some custom reporters:
fail
- Emits an error at the end of the stream if there are lint errors.failImmediately
- Emits an error immediately if there are lint errors.MIT © Sindre Sorhus
FAQs
Check JavaScript code style with jscs
We found that gulp-jscs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.