🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

grunt-eslint

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-eslint

Validate files with ESLint

25.0.0
latest
Source
npm
Version published
Weekly downloads
178K
-18.78%
Maintainers
1
Weekly downloads
 
Created

What is grunt-eslint?

grunt-eslint is a Grunt plugin for running ESLint, a tool for identifying and fixing problems in JavaScript code. It allows developers to integrate ESLint into their Grunt-based build processes, enabling automated linting of JavaScript files.

What are grunt-eslint's main functionalities?

Linting JavaScript files

This feature allows you to lint JavaScript files using ESLint through Grunt. The code sample demonstrates how to configure grunt-eslint to lint all JavaScript files in the 'src' directory and its subdirectories.

module.exports = function(grunt) {
  grunt.initConfig({
    eslint: {
      target: ['src/**/*.js']
    }
  });

  grunt.loadNpmTasks('grunt-eslint');

  grunt.registerTask('default', ['eslint']);
};

Custom ESLint configuration

This feature allows you to specify a custom ESLint configuration file. The code sample shows how to use a specific '.eslintrc.json' file for linting configuration.

module.exports = function(grunt) {
  grunt.initConfig({
    eslint: {
      options: {
        configFile: '.eslintrc.json'
      },
      target: ['src/**/*.js']
    }
  });

  grunt.loadNpmTasks('grunt-eslint');

  grunt.registerTask('default', ['eslint']);
};

Fixing linting errors automatically

This feature enables automatic fixing of linting errors where possible. The code sample demonstrates how to configure grunt-eslint to automatically fix issues in the JavaScript files.

module.exports = function(grunt) {
  grunt.initConfig({
    eslint: {
      options: {
        fix: true
      },
      target: ['src/**/*.js']
    }
  });

  grunt.loadNpmTasks('grunt-eslint');

  grunt.registerTask('default', ['eslint']);
};

Other packages similar to grunt-eslint

Keywords

gruntplugin

FAQs

Package last updated on 11 Apr 2024

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