File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -82,14 +82,19 @@ const processReport = (report, {isQuiet = false} = {}) => {
8282 return result ;
8383} ;
8484
85- const runEslint = async ( file , options , processorOptions ) => {
85+ const runEslint = async ( filePath , options , processorOptions ) => {
86+ const filename = path . relative ( options . cwd , filePath ) ;
8687 const engine = new ESLint ( options ) ;
8788
88- if ( await engine . isPathIgnored ( file ) ) {
89- return getEmptyReport ( file ) ;
89+ if (
90+ micromatch . isMatch ( filename , options . baseConfig . ignorePatterns )
91+ || isGitIgnoredSync ( { cwd : options . cwd , ignore : options . baseConfig . ignorePatterns } ) ( filePath )
92+ || await engine . isPathIgnored ( filePath )
93+ ) {
94+ return ;
9095 }
9196
92- const report = await engine . lintFiles ( [ file ] ) ;
97+ const report = await engine . lintFiles ( [ filePath ] ) ;
9398 return processReport ( report , processorOptions ) ;
9499} ;
95100
@@ -165,7 +170,7 @@ const lintFiles = async (patterns, inputOptions = {}) => {
165170 } ,
166171 ) ;
167172
168- return mergeReports ( reports ) ;
173+ return mergeReports ( reports . filter ( Boolean ) ) ;
169174} ;
170175
171176const getFormatter = async name => {
You can’t perform that action at this time.
0 commit comments