1- import { isAbsolute , join } from 'path' ;
1+ const { isAbsolute, join } = require ( 'path' ) ;
22
3- // @ts -ignore
4- import globby from 'globby' ;
3+ const globby = require ( 'globby' ) ;
4+ const { isMatch } = require ( 'micromatch' ) ;
55
6- import { isMatch } from 'micromatch' ;
7-
8- import { getOptions } from './options' ;
9- import linter from './linter' ;
10- import { arrify , parseFiles , parseFoldersToGlobs } from './utils' ;
6+ const { getOptions } = require ( './options' ) ;
7+ const linter = require ( './linter' ) ;
8+ const { arrify, parseFiles, parseFoldersToGlobs } = require ( './utils' ) ;
119
1210/** @typedef {import('webpack').Compiler } Compiler */
1311/** @typedef {import('webpack').Module } Module */
@@ -110,6 +108,8 @@ class StylelintWebpackPlugin {
110108 }
111109
112110 compilation . hooks . finishModules . tapPromise ( this . key , async ( ) => {
111+ /** @type {string[] } */
112+ // @ts -ignore
113113 const files = (
114114 await Promise . all (
115115 ( compiler . modifiedFiles
@@ -119,7 +119,7 @@ class StylelintWebpackPlugin {
119119 ! isMatch ( file , exclude , { dot : true } )
120120 )
121121 : globby . sync ( wanted , { dot : true , ignore : exclude } )
122- ) . map ( async ( /** @type { string | undefined } */ file ) => {
122+ ) . map ( async ( file ) => {
123123 try {
124124 return ( await api . isPathIgnored ( file ) ) ? false : file ;
125125 } catch ( e ) {
@@ -185,4 +185,4 @@ class StylelintWebpackPlugin {
185185 }
186186}
187187
188- export default StylelintWebpackPlugin ;
188+ module . exports = StylelintWebpackPlugin ;
0 commit comments