File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -61,10 +61,11 @@ class StylelintWebpackPlugin {
6161 ) ;
6262 }
6363
64- let isFirstRun = this . options . lintDirtyModulesOnly ;
64+ let hasCompilerRunByDirtyModule = this . options . lintDirtyModulesOnly ;
65+
6566 compiler . hooks . watchRun . tapPromise ( this . key , ( compiler ) => {
66- if ( isFirstRun ) {
67- isFirstRun = false ;
67+ if ( hasCompilerRunByDirtyModule ) {
68+ hasCompilerRunByDirtyModule = false ;
6869
6970 return Promise . resolve ( ) ;
7071 }
@@ -81,12 +82,11 @@ class StylelintWebpackPlugin {
8182 */
8283 async run ( compiler , options , wanted , exclude ) {
8384 // Do not re-hook
84- /* istanbul ignore if */
85- if (
86- compiler . hooks . thisCompilation . taps . some ( ( { name } ) => name === this . key )
87- ) {
88- return ;
89- }
85+ const isCompilerHooked = compiler . hooks . thisCompilation . taps . find (
86+ ( { name } ) => name === this . key ,
87+ ) ;
88+
89+ if ( isCompilerHooked ) return ;
9090
9191 compiler . hooks . thisCompilation . tap ( this . key , ( compilation ) => {
9292 /** @type {import('./linter').Linter } */
You can’t perform that action at this time.
0 commit comments