Skip to content

Commit 22fcb14

Browse files
committed
Fix misplaced cache option for the eslint-loader
1 parent 0738691 commit 22fcb14

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/config-generator.js

-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ class ConfigGenerator {
235235
loader: 'eslint-loader',
236236
exclude: /node_modules/,
237237
enforce: 'pre',
238-
cache: true,
239238
options: eslintLoaderUtil.getOptions(this.webpackConfig)
240239
});
241240
}

lib/loaders/eslint.js

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module.exports = {
2121
loaderFeatures.ensurePackagesExist('eslint');
2222

2323
const eslintLoaderOptions = {
24+
cache: true,
2425
parser: 'babel-eslint',
2526
emitWarning: true,
2627
'import/resolver': {

test/loaders/eslint.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ describe('loaders/eslint', () => {
2828
config.enableEslintLoader();
2929
const actualOptions = eslintLoader.getOptions(config);
3030

31-
expect(Object.keys(actualOptions)).to.have.lengthOf(3);
31+
expect(Object.keys(actualOptions)).to.have.lengthOf(4);
3232
});
3333

3434
it('getOptions() with extra options', () => {
@@ -39,7 +39,7 @@ describe('loaders/eslint', () => {
3939

4040
const actualOptions = eslintLoader.getOptions(config);
4141

42-
expect(Object.keys(actualOptions)).to.have.lengthOf(4);
42+
expect(Object.keys(actualOptions)).to.have.lengthOf(5);
4343
expect(actualOptions.extends).to.equal('airbnb');
4444
});
4545

@@ -51,7 +51,7 @@ describe('loaders/eslint', () => {
5151

5252
const actualOptions = eslintLoader.getOptions(config);
5353

54-
expect(Object.keys(actualOptions)).to.have.lengthOf(3);
54+
expect(Object.keys(actualOptions)).to.have.lengthOf(4);
5555
expect(actualOptions.emitWarning).to.equal(false);
5656
});
5757

0 commit comments

Comments
 (0)