File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,14 @@ import {
10
10
} from "./git" ;
11
11
import type { Range } from "./Range" ;
12
12
13
+ if ( process . env . CI !== undefined ) {
14
+ const branch = process . env . ESLINT_PLUGIN_DIFF_COMMIT ?? guessBranch ( ) ;
15
+ if ( branch !== undefined ) {
16
+ process . env . ESLINT_PLUGIN_DIFF_COMMIT = branch ;
17
+ fetchFromOrigin ( branch ) ;
18
+ }
19
+ }
20
+
13
21
/**
14
22
* Exclude unchanged files from being processed
15
23
*
@@ -101,16 +109,6 @@ const getProcessors = (
101
109
processorType : ProcessorType
102
110
) : Required < Linter . Processor > => {
103
111
const staged = processorType === "staged" ;
104
- if ( processorType === "ci" ) {
105
- if ( process . env . CI === undefined ) {
106
- throw Error ( "Expected CI environment" ) ;
107
- }
108
-
109
- const branch = process . env . ESLINT_PLUGIN_DIFF_COMMIT ?? guessBranch ( ) ;
110
- if ( branch !== undefined ) {
111
- fetchFromOrigin ( branch ) ;
112
- }
113
- }
114
112
const untrackedFileList = getUntrackedFileList ( staged ) ;
115
113
const diffFileList = getDiffFileList ( staged ) ;
116
114
You can’t perform that action at this time.
0 commit comments