Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
Revert "Added: eslintPath option (#181)"
Browse files Browse the repository at this point in the history
This reverts commit ff4737c.
  • Loading branch information
MoOx committed Jun 15, 2017
1 parent 79fa82e commit c9e9f12
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 89 deletions.
22 changes: 0 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,28 +142,6 @@ module.exports = {
}
```

#### `eslintPath` (default: "eslint")

Path to `eslint` instance that will be used for linting.

```js
module.exports = {
entry: "...",
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: "eslint-loader",
options: {
eslintPath: path.join(__dirname, "reusable-eslint-rules.js"),
}
},
],
},
}
```

#### Errors and Warning

**By default the loader will auto adjust error reporting depending
Expand Down
19 changes: 6 additions & 13 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict"

var eslint = require("eslint")
var assign = require("object-assign")
var loaderUtils = require("loader-utils")
var objectHash = require("object-hash")
Expand Down Expand Up @@ -67,7 +68,6 @@ function printLinterOutput(res, config, webpack) {

// if enabled, use eslint auto-fixing where possible
if (config.fix && res.results[0].output) {
var eslint = require(config.eslintPath)
eslint.CLIEngine.outputFixes(res)
}

Expand Down Expand Up @@ -142,25 +142,19 @@ function printLinterOutput(res, config, webpack) {
*/
module.exports = function(input, map) {
var webpack = this

var userOptions = assign(
// user defaults
this.options.eslint || {},
// loader query string
loaderUtils.getOptions(this)
)

var config = assign(
// loader defaults
{
formatter: require("eslint/lib/formatters/stylish"),
cacheIdentifier: JSON.stringify({
"eslint-loader": pkg.version,
eslint: require(userOptions.eslintPath || "eslint").version,
eslint: eslint.version,
}),
eslintPath: "eslint",
},
userOptions
// user defaults
this.options.eslint || {},
// loader query string
loaderUtils.getOptions(this)
)

var cacheDirectory = config.cache
Expand All @@ -172,7 +166,6 @@ module.exports = function(input, map) {
// Create the engine only once per config
var configHash = objectHash(config)
if (!engines[configHash]) {
var eslint = require(config.eslintPath)
engines[configHash] = new eslint.CLIEngine(config)
}

Expand Down
33 changes: 0 additions & 33 deletions test/eslint-path.js

This file was deleted.

21 changes: 0 additions & 21 deletions test/mock/eslint-mock.js

This file was deleted.

0 comments on commit c9e9f12

Please sign in to comment.