11import { promises as fs , type Dirent } from 'fs' ;
22import pathlib from 'path' ;
3- import { getBundlesDir , getGitRoot , getOutDir , getTabsDir } from '@sourceacademy/modules-repotools/getGitRoot' ;
3+ import { bundlesDir , gitRoot , outDir , tabsDir } from '@sourceacademy/modules-repotools/getGitRoot' ;
44import type { InputAsset , Severity } from '@sourceacademy/modules-repotools/types' ;
55import { findSeverity , flatMapAsync , isNodeError } from '@sourceacademy/modules-repotools/utils' ;
66import chalk from 'chalk' ;
@@ -35,7 +35,6 @@ async function timePromise<T>(f: () => Promise<T>) {
3535}
3636
3737export async function runEslint ( input : InputAsset , fix : boolean , stats : boolean ) : Promise < LintResult > {
38- const gitRoot = await getGitRoot ( ) ;
3938 const linter = new ESLint ( {
4039 fix,
4140 stats,
@@ -49,7 +48,6 @@ export async function runEslint(input: InputAsset, fix: boolean, stats: boolean)
4948 }
5049
5150 if ( stats ) {
52- const outDir = await getOutDir ( ) ;
5351 await fs . mkdir ( `${ outDir } /lintstats` , { recursive : true } ) ;
5452
5553 const statsFormatter = await linter . loadFormatter ( 'json' ) ;
@@ -104,12 +102,6 @@ interface LintGlobalResults {
104102 * so that the bundles and tabs can be linted separately.
105103 */
106104export async function lintGlobal ( fix : boolean ) : Promise < LintGlobalResults > {
107- const [ gitRoot , bundlesDir , tabsDir ] = await Promise . all ( [
108- getGitRoot ( ) ,
109- getBundlesDir ( ) ,
110- getTabsDir ( )
111- ] ) ;
112-
113105 const linter = new ESLint ( { fix, cwd : gitRoot } ) ;
114106
115107 /**
0 commit comments