Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-eslint

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-eslint

A gulp plugin for processing files with ESLint

  • 6.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
167K
increased by13.27%
Maintainers
2
Weekly downloads
 
Created

What is gulp-eslint?

gulp-eslint is a Gulp plugin for ESLint, a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. It helps developers maintain code quality by enforcing coding standards and detecting potential errors.

What are gulp-eslint's main functionalities?

Linting JavaScript files

This feature allows you to lint JavaScript files in your project. The code sample demonstrates how to set up a Gulp task that lints all JavaScript files except those in the node_modules directory, formats the linting results, and fails the task if any errors are found.

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

gulp.task('lint', () => {
  return gulp.src(['**/*.js', '!node_modules/**'])
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failAfterError());
});

Custom ESLint configuration

This feature allows you to specify custom ESLint rules and environments directly within the Gulp task. The code sample shows how to configure ESLint to enforce single quotes and semicolons, and to recognize browser and Node.js environments.

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

gulp.task('lint', () => {
  return gulp.src(['**/*.js', '!node_modules/**'])
    .pipe(eslint({
      rules: {
        'quotes': ['error', 'single'],
        'semi': ['error', 'always']
      },
      envs: ['browser', 'node']
    }))
    .pipe(eslint.format())
    .pipe(eslint.failAfterError());
});

Linting specific files

This feature allows you to lint specific sets of files. The code sample demonstrates how to set up a Gulp task that only lints JavaScript files in the 'src/scripts' directory.

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

gulp.task('lint-scripts', () => {
  return gulp.src('src/scripts/**/*.js')
    .pipe(eslint())
    .pipe(eslint.format())
    .pipe(eslint.failAfterError());
});

Other packages similar to gulp-eslint

Keywords

FAQs

Package last updated on 28 Jun 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc