@@ -16,15 +16,15 @@ import {
1616 mergeWithFileConfig ,
1717 mergeWithFileConfigs ,
1818 buildConfig ,
19- mergeOptions
19+ mergeOptions ,
2020} from './lib/options-manager.js' ;
2121
2222/** Merge multiple reports into a single report */
2323const mergeReports = reports => {
2424 const report = {
2525 results : [ ] ,
2626 errorCount : 0 ,
27- warningCount : 0
27+ warningCount : 0 ,
2828 } ;
2929
3030 for ( const currentReport of reports ) {
@@ -41,7 +41,7 @@ const getReportStatistics = results => {
4141 errorCount : 0 ,
4242 warningCount : 0 ,
4343 fixableErrorCount : 0 ,
44- fixableWarningCount : 0
44+ fixableWarningCount : 0 ,
4545 } ;
4646
4747 for ( const result of results ) {
@@ -61,7 +61,7 @@ const processReport = (report, {isQuiet = false} = {}) => {
6161
6262 const result = {
6363 results : report ,
64- ...getReportStatistics ( report )
64+ ...getReportStatistics ( report ) ,
6565 } ;
6666
6767 defineLazyProperty ( result , 'usedDeprecatedRules' , ( ) => {
@@ -95,7 +95,7 @@ const runEslint = async (paths, options, processorOptions) => {
9595const globFiles = async ( patterns , { ignores, extensions, cwd} ) => (
9696 await globby (
9797 patterns . length === 0 ? [ `**/*.{${ extensions . join ( ',' ) } }` ] : arrify ( patterns ) ,
98- { ignore : ignores , gitignore : true , cwd}
98+ { ignore : ignores , gitignore : true , cwd} ,
9999 ) ) . filter ( file => extensions . includes ( path . extname ( file ) . slice ( 1 ) ) ) . map ( file => path . resolve ( cwd , file ) ) ;
100100
101101const getConfig = async options => {
@@ -120,9 +120,9 @@ const lintText = async (string, inputOptions = {}) => {
120120 const filename = path . relative ( options . cwd , filePath ) ;
121121
122122 if (
123- micromatch . isMatch ( filename , options . baseConfig . ignorePatterns ) ||
124- globby . gitignore . sync ( { cwd : options . cwd , ignore : options . baseConfig . ignorePatterns } ) ( filePath ) ||
125- await engine . isPathIgnored ( filePath )
123+ micromatch . isMatch ( filename , options . baseConfig . ignorePatterns )
124+ || globby . gitignore . sync ( { cwd : options . cwd , ignore : options . baseConfig . ignorePatterns } ) ( filePath )
125+ || await engine . isPathIgnored ( filePath )
126126 ) {
127127 return {
128128 errorCount : 0 ,
@@ -131,8 +131,8 @@ const lintText = async (string, inputOptions = {}) => {
131131 errorCount : 0 ,
132132 filePath : filename ,
133133 messages : [ ] ,
134- warningCount : 0
135- } ]
134+ warningCount : 0 ,
135+ } ] ,
136136 } ;
137137 }
138138 }
@@ -149,17 +149,17 @@ const lintFiles = async (patterns, inputOptions = {}) => {
149149 const configFiles = ( await Promise . all (
150150 ( await globby (
151151 CONFIG_FILES . map ( configFile => `**/${ configFile } ` ) ,
152- { ignore : DEFAULT_IGNORES , gitignore : true , cwd : inputOptions . cwd }
153- ) ) . map ( async configFile => configExplorer . load ( path . resolve ( inputOptions . cwd , configFile ) ) )
152+ { ignore : DEFAULT_IGNORES , gitignore : true , cwd : inputOptions . cwd } ,
153+ ) ) . map ( async configFile => configExplorer . load ( path . resolve ( inputOptions . cwd , configFile ) ) ) ,
154154 ) ) . filter ( Boolean ) ;
155155
156- const paths = configFiles . length > 0 ?
157- await pReduce (
156+ const paths = configFiles . length > 0
157+ ? await pReduce (
158158 configFiles ,
159159 async ( paths , { filepath, config} ) =>
160160 [ ...paths , ...( await globFiles ( patterns , { ...mergeOptions ( inputOptions , config ) , cwd : path . dirname ( filepath ) } ) ) ] ,
161- [ ] ) :
162- await globFiles ( patterns , mergeOptions ( inputOptions ) ) ;
161+ [ ] )
162+ : await globFiles ( patterns , mergeOptions ( inputOptions ) ) ;
163163
164164 return mergeReports ( await pMap ( await mergeWithFileConfigs ( [ ...new Set ( paths ) ] , inputOptions , configFiles ) , async ( { files, options, prettierOptions} ) => runEslint ( files , buildConfig ( options , prettierOptions ) , { isQuiet : options . quiet } ) ) ) ;
165165} ;
@@ -175,5 +175,5 @@ export default {
175175 outputFixes : async ( { results} ) => ESLint . outputFixes ( results ) ,
176176 getConfig,
177177 lintText,
178- lintFiles
178+ lintFiles,
179179} ;
0 commit comments