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

Commit c9e9f12

Browse files
committed
Revert "Added: eslintPath option (#181)"
This reverts commit ff4737c.
1 parent 79fa82e commit c9e9f12

File tree

4 files changed

+6
-89
lines changed

4 files changed

+6
-89
lines changed

README.md

-22
Original file line numberDiff line numberDiff line change
@@ -142,28 +142,6 @@ module.exports = {
142142
}
143143
```
144144

145-
#### `eslintPath` (default: "eslint")
146-
147-
Path to `eslint` instance that will be used for linting.
148-
149-
```js
150-
module.exports = {
151-
entry: "...",
152-
module: {
153-
rules: [
154-
{
155-
test: /\.js$/,
156-
exclude: /node_modules/,
157-
loader: "eslint-loader",
158-
options: {
159-
eslintPath: path.join(__dirname, "reusable-eslint-rules.js"),
160-
}
161-
},
162-
],
163-
},
164-
}
165-
```
166-
167145
#### Errors and Warning
168146

169147
**By default the loader will auto adjust error reporting depending

index.js

+6-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"use strict"
22

3+
var eslint = require("eslint")
34
var assign = require("object-assign")
45
var loaderUtils = require("loader-utils")
56
var objectHash = require("object-hash")
@@ -67,7 +68,6 @@ function printLinterOutput(res, config, webpack) {
6768

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

@@ -142,25 +142,19 @@ function printLinterOutput(res, config, webpack) {
142142
*/
143143
module.exports = function(input, map) {
144144
var webpack = this
145-
146-
var userOptions = assign(
147-
// user defaults
148-
this.options.eslint || {},
149-
// loader query string
150-
loaderUtils.getOptions(this)
151-
)
152-
153145
var config = assign(
154146
// loader defaults
155147
{
156148
formatter: require("eslint/lib/formatters/stylish"),
157149
cacheIdentifier: JSON.stringify({
158150
"eslint-loader": pkg.version,
159-
eslint: require(userOptions.eslintPath || "eslint").version,
151+
eslint: eslint.version,
160152
}),
161-
eslintPath: "eslint",
162153
},
163-
userOptions
154+
// user defaults
155+
this.options.eslint || {},
156+
// loader query string
157+
loaderUtils.getOptions(this)
164158
)
165159

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

test/eslint-path.js

-33
This file was deleted.

test/mock/eslint-mock.js

-21
This file was deleted.

0 commit comments

Comments
 (0)