File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -81,15 +81,15 @@ export default function ESLintPlugin(
81
81
} ,
82
82
async transform ( _ , id ) {
83
83
debug ( "==== transform hook ====" ) ;
84
- debug ( `id: ${ id } ` ) ;
85
- const filePath = getFilePath ( id ) ;
86
- debug ( `filePath: ${ filePath } ` ) ;
87
84
// worker
88
- if ( worker ) return worker . postMessage ( filePath ) ;
85
+ if ( worker ) return worker . postMessage ( id ) ;
89
86
// no worker
87
+ debug ( `id: ${ id } ` ) ;
90
88
const shouldIgnore = await shouldIgnoreModule ( id , filter , eslintInstance ) ;
91
89
debug ( `should ignore: ${ shouldIgnore } ` ) ;
92
90
if ( shouldIgnore ) return ;
91
+ const filePath = getFilePath ( id ) ;
92
+ debug ( `filePath: ${ filePath } ` ) ;
93
93
return await lintFiles (
94
94
{
95
95
files : options . lintDirtyOnly ? filePath : options . include ,
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import type {
8
8
ESLintPluginOptions ,
9
9
} from "./types" ;
10
10
import {
11
+ getFilePath ,
11
12
getFilter ,
12
13
initializeESLint ,
13
14
lintFiles ,
@@ -48,16 +49,18 @@ const initPromise = initializeESLint(options).then((result) => {
48
49
}
49
50
} ) ( ) ;
50
51
51
- parentPort ?. on ( "message" , async ( files ) => {
52
+ parentPort ?. on ( "message" , async ( id ) => {
52
53
// make sure eslintInstance is initialized
53
54
if ( ! eslintInstance ) await initPromise ;
54
55
debug ( "==== worker message event ====" ) ;
55
- debug ( `message : ${ files } ` ) ;
56
- const shouldIgnore = await shouldIgnoreModule ( files , filter , eslintInstance ) ;
56
+ debug ( `id : ${ id } ` ) ;
57
+ const shouldIgnore = await shouldIgnoreModule ( id , filter , eslintInstance ) ;
57
58
debug ( `should ignore: ${ shouldIgnore } ` ) ;
58
59
if ( shouldIgnore ) return ;
60
+ const filePath = getFilePath ( id ) ;
61
+ debug ( `filePath: ${ filePath } ` ) ;
59
62
lintFiles ( {
60
- files : options . lintDirtyOnly ? files : options . include ,
63
+ files : options . lintDirtyOnly ? filePath : options . include ,
61
64
eslintInstance,
62
65
formatter,
63
66
outputFixes,
You can’t perform that action at this time.
0 commit comments