File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -15,11 +15,7 @@ const getCachedDiff = (filePath: string, staged: boolean) =>
15
15
diffCache . get ( diffCacheKey ( filePath , staged ) ) ;
16
16
17
17
const diffCache = new Map < string , string > ( ) ;
18
- const getDiffForFile = (
19
- filePath : string ,
20
- staged = false ,
21
- changesBetween = process . env . ESLINT_PLUGIN_DIFF_COMMIT ?? "HEAD"
22
- ) : string => {
18
+ const getDiffForFile = ( filePath : string , staged = false ) : string => {
23
19
let diff = getCachedDiff ( filePath , staged ) ;
24
20
if ( diff === undefined ) {
25
21
const command = [
@@ -28,7 +24,7 @@ const getDiffForFile = (
28
24
"--diff-filter=ACM" ,
29
25
staged && "--staged" ,
30
26
"--unified=0" ,
31
- changesBetween ,
27
+ process . env . ESLINT_PLUGIN_DIFF_COMMIT ?? "HEAD" ,
32
28
"--" ,
33
29
sanitizeFilePath ( filePath ) ,
34
30
]
@@ -44,18 +40,15 @@ const getDiffForFile = (
44
40
} ;
45
41
46
42
let diffFileListCache : string [ ] ;
47
- const getDiffFileList = (
48
- staged = false ,
49
- changesBetween = process . env . ESLINT_PLUGIN_DIFF_COMMIT ?? "HEAD"
50
- ) : string [ ] => {
43
+ const getDiffFileList = ( staged = false ) : string [ ] => {
51
44
if ( diffFileListCache === undefined ) {
52
45
const command = [
53
46
"git" ,
54
47
"diff" ,
55
48
"--diff-filter=ACM" ,
56
49
"--name-only" ,
57
50
staged && "--staged" ,
58
- changesBetween ,
51
+ process . env . ESLINT_PLUGIN_DIFF_COMMIT ?? "HEAD" ,
59
52
]
60
53
. filter ( Boolean )
61
54
. join ( " " ) ;
You can’t perform that action at this time.
0 commit comments