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

grunt-contrib-eslint

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-eslint

Validate files with ESLint

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
70
decreased by-72.22%
Maintainers
1
Weekly downloads
 
Created
Source

NPM version

grunt-contrib-eslint

Grunt plugin for Eslint

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

$ npm install --save-dev grunt-contrib-eslint

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks("grunt-contrib-eslint");

Documentation

See the grunt docs on how to configure tasks and more advanced usage.

Example

grunt.initConfig({
	eslint: {					
		src: ["app.js"]
	}
});

grunt.loadNpmTasks("grunt-contrib-eslint");
grunt.registerTask("default", ["eslint"]);

Example with custom config and rules

grunt.initConfig({
	eslint: {					
		options: {
			config: "conf/eslint.json",	
			rulesdir: ["conf/rules"]		
		},
		src: ["app.js"]
	}
});

grunt.loadNpmTasks("grunt-contrib-eslint");
grunt.registerTask("default", ["eslint"]);

Example with custom formatter

grunt.initConfig({
	eslint: {						
		options: {
			format: "./formatter/htmlTable"
		},
		src: ["app.js"]		
	}
});

grunt.loadNpmTasks("grunt-contrib-eslint");
grunt.registerTask("default", ["eslint"]);

Example with custom rules for node and browser files

grunt.config.init({
  eslint: {
    nodeFiles: {
      src: ["server/**/*.js"],
      options: {
        config: "conf/eslint-node.json"
      }
    },

    browserFiles: {
      src: ["client/**/*.js"]
      options: {
        config: "conf/eslint-browser.json"
      }
    }
  }
});

grunt.loadNpmTasks("grunt-contrib-eslint");
grunt.registerTask("default", ["eslint"]);

Example with silent option

grunt.initConfig({
	eslint: {						
		options: {
			format: "./formatter/htmlTable",
			silent: true
		},
		src: ["app.js"]		
	}
});

grunt.loadNpmTasks("grunt-contrib-eslint");
grunt.registerTask("default", ["eslint"]);

Options

config

Type: path::String

rulesdir

Type: [path::String]
Default: built-in rules directory

format

Type: String
Default: 'stylish'

Name of a built-in formatter or path to a custom one.

silent

Type: Boolean

Whether the grunt task would fail on error or will it alwways pass irrespective of the results. i.e. to supress the failure. This option is not passed to the eslint api.

** More information about options: Eslint options

Keywords

FAQs

Package last updated on 05 Sep 2014

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