@@ -17,6 +17,12 @@ var conf = {
17
17
} ,
18
18
] ,
19
19
} ,
20
+ // this disables the use of .eslintignore, since it contains the fixtures
21
+ // folder to skip it on the global linting, but here we want the opposite
22
+ // (we only use .eslintignore on the test that checks this)
23
+ eslint : {
24
+ ignore : false ,
25
+ } ,
20
26
}
21
27
22
28
test ( "eslint-loader don't throw error if file is ok" , function ( t ) {
@@ -56,9 +62,9 @@ test("eslint-loader only returns errors and not warnings if quiet is set", funct
56
62
conf ,
57
63
{
58
64
entry : "./test/fixtures/warn.js" ,
59
- eslint : {
65
+ eslint : assign ( { } , conf . eslint , {
60
66
quiet : true ,
61
- } ,
67
+ } ) ,
62
68
}
63
69
) ,
64
70
function ( err , stats ) {
@@ -90,9 +96,9 @@ test("eslint-loader can force to emit error", function(t) {
90
96
conf ,
91
97
{
92
98
entry : "./test/fixtures/warn.js" ,
93
- eslint : {
99
+ eslint : assign ( { } , conf . eslint , {
94
100
emitError : true ,
95
- } ,
101
+ } ) ,
96
102
}
97
103
) ,
98
104
function ( err , stats ) {
@@ -109,9 +115,9 @@ test("eslint-loader can force to emit warning", function(t) {
109
115
conf ,
110
116
{
111
117
entry : "./test/fixtures/error.js" ,
112
- eslint : {
118
+ eslint : assign ( { } , conf . eslint , {
113
119
emitWarning : true ,
114
- } ,
120
+ } ) ,
115
121
}
116
122
) ,
117
123
function ( err , stats ) {
@@ -145,9 +151,9 @@ test("eslint-loader can use custom formatter", function(t) {
145
151
conf ,
146
152
{
147
153
entry : "./test/fixtures/error.js" ,
148
- eslint : {
154
+ eslint : assign ( { } , conf . eslint , {
149
155
formatter : require ( "eslint-friendly-formatter" ) ,
150
- } ,
156
+ } ) ,
151
157
}
152
158
) ,
153
159
function ( err , stats ) {
@@ -184,3 +190,23 @@ test("eslint-loader supports query strings parameters", function(t) {
184
190
t . end ( )
185
191
} )
186
192
} )
193
+
194
+ test ( "eslint-loader ignores files present in .eslintignore" , function ( t ) {
195
+ webpack ( assign ( { } ,
196
+ conf ,
197
+ {
198
+ entry : "./test/fixtures/ignore.js" ,
199
+ eslint : assign ( { } , conf . eslint , {
200
+ // we want to enable ignore, so eslint will parse .eslintignore and
201
+ // should skip the file specified above
202
+ ignore : true ,
203
+ } ) ,
204
+ }
205
+ ) ,
206
+ function ( err , stats ) {
207
+ if ( err ) { throw err }
208
+
209
+ t . ok ( stats . hasWarnings ( ) , "an ignored file gives a warning" )
210
+ t . end ( )
211
+ } )
212
+ } )
0 commit comments