@@ -17,34 +17,24 @@ const STAGED = true;
17
17
* them from being processed in the first place, as a performance optimization.
18
18
* This is increasingly useful the more files there are in the repository.
19
19
*/
20
- const getPreProcessor = (
21
- untrackedFileList : string [ ] ,
22
- diffFileList : string [ ]
23
- ) => {
24
- return ( text : string , filename : string ) => {
20
+ const getPreProcessor =
21
+ ( untrackedFileList : string [ ] , diffFileList : string [ ] ) =>
22
+ ( text : string , filename : string ) => {
25
23
const shouldBeProcessed =
26
24
process . env . VSCODE_CLI !== undefined ||
27
25
diffFileList . includes ( filename ) ||
28
26
untrackedFileList . includes ( filename ) ;
29
- // console.error({
30
- // untrackedFileList,
31
- // diffFileList,
32
- // text,
33
- // filename,
34
- // shouldBeProcessed,
35
- // });
36
27
37
28
return shouldBeProcessed ? [ text ] : [ ] ;
38
29
} ;
39
- } ;
40
30
41
31
const isLineWithinRange = ( line : number ) => ( range : Range ) =>
42
32
range . isWithinRange ( line ) ;
43
33
44
34
/**
45
35
* @internal
46
36
*/
47
- function getUnstagedChangesError ( filename : string ) {
37
+ function getUnstagedChangesError ( filename : string ) : [ Linter . LintMessage ] {
48
38
// When we only want to diff staged files, but the file is partially
49
39
// staged, the ranges of the staged diff might not match the ranges of the
50
40
// unstaged diff and could cause a conflict, so we return a fatal
@@ -65,8 +55,9 @@ function getUnstagedChangesError(filename: string) {
65
55
return [ fatalError ] ;
66
56
}
67
57
68
- const getPostProcessor = ( untrackedFileList : string [ ] , staged = false ) => {
69
- return (
58
+ const getPostProcessor =
59
+ ( untrackedFileList : string [ ] , staged = false ) =>
60
+ (
70
61
messages : Linter . LintMessage [ ] [ ] ,
71
62
filename : string
72
63
) : Linter . LintMessage [ ] => {
@@ -103,7 +94,6 @@ const getPostProcessor = (untrackedFileList: string[], staged = false) => {
103
94
return filteredMessage ;
104
95
} ) ;
105
96
} ;
106
- } ;
107
97
108
98
const getProcessors = ( staged = false ) : Required < Linter . Processor > => {
109
99
const untrackedFileList = getUntrackedFileList ( staged ) ;
0 commit comments