Socket
Socket
Sign inDemoInstall

eslint-loader

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-loader - npm Package Compare versions

Comparing version 0.5.0 to 0.6.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# 0.6.0 - 2015-02-11
- Changed: `reporter` now automatically drop lines that contains the filename in the reporter output
That mean you can use official or community reporters without worring to see lot of lines with `<text>` as filename :)
# 0.5.0 - 2015-02-11

@@ -2,0 +7,0 @@

8

index.js
"use strict";
var eslint = require("eslint")
var stylish = require("eslint/lib/formatters/stylish")

@@ -33,4 +32,5 @@ // eslint empty filename

if (res.errorCount || res.warningCount) {
var reporter = webpack.options.eslint.reporter || function(results) {
return stylish(results).split("\n").filter(function(line) {
var messages = webpack.options.eslint.reporter(res.results)
if (messages.indexOf(TEXT) > -1) {
messages = messages.split("\n").filter(function(line) {
// drop the line that should contains filepath we do not have

@@ -40,3 +40,2 @@ return !line.match(TEXT)

}
var messages = reporter(res.results)

@@ -71,2 +70,3 @@ // default behavior: emit error only if we have errors

this.options.eslint = this.options.eslint || {}
this.options.eslint.reporter = this.options.eslint.reporter || require("eslint/lib/formatters/stylish")
this.cacheable()

@@ -73,0 +73,0 @@

{
"name": "eslint-loader",
"version": "0.5.0",
"version": "0.6.0",
"description": "eslint loader (for webpack)",

@@ -34,2 +34,3 @@ "keywords": [

"eslint": "^0.16.0",
"eslint-friendly-formatter": "^1.0.3",
"tape": "^3.0.3",

@@ -36,0 +37,0 @@ "webpack": "^1.4.13"

@@ -39,7 +39,38 @@ # eslint-loader [![Build Status](http://img.shields.io/travis/MoOx/eslint-loader.svg)](https://travis-ci.org/MoOx/eslint-loader)

#### `reporter` (default: wrapper eslint stylish reporter)
#### `reporter` (default: eslint stylish reporter)
Loader accepts a function that will have one argument: an array of eslint messages (object).
The function must return the output as a string.
You can use official eslint reporters.
**Please note that every lines with the filename will be skipped from output**
because of the way the loader use eslint (just with a string of text, not a file - so no filename available)
```js
module.exports = {
entry: "...",
module: {
// ...
}
eslint: {
// several examples !
// default value
reporter: require("eslint/lib/formatters/stylish"),
// community reporter
reporter: require("eslint-friendly-formatter")
// custom reporter
reporter: function(results) {
// `results` format is available here
// http://eslint.org/docs/developer-guide/nodejs-api.html#executeonfiles()
// you should return a string
// DO NOT USE console.*() directly !
return "OUTPUT"
}
}
}
```
#### Errors and Warning

@@ -46,0 +77,0 @@

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