Skip to content

Commit fada712

Browse files
committed
Fix tsc error
1 parent bec27ff commit fada712

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

lib/buildtools/src/build/all.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export type BuildAllResult = BuildAllPrebuildError | BuildAllBundleResult | Buil
4040
export async function buildAll(input: InputAsset, prebuild: PrebuildOptions, outDir: string, logLevel: LogLevel): Promise<BuildAllResult> {
4141
const [tscResult, lintResult] = await Promise.all([
4242
prebuild.tsc ? runTsc(input, true) : Promise.resolve(undefined),
43-
prebuild.lint ? runEslint(input, false, false) : Promise.resolve(undefined)
43+
prebuild.lint ? runEslint(input) : Promise.resolve(undefined)
4444
]);
4545

4646
if (tscResult?.severity === 'error' || lintResult?.severity === 'error') {

lib/buildtools/src/prebuild/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export async function runBuilderWithPrebuild<T extends InputAsset, U extends any
3131
): Promise<RunPrebuildResult<V>> {
3232
const promises: [Promise<TscResult | undefined>, Promise<LintResult | undefined>] = [
3333
!tsc ? Promise.resolve(undefined) : runTsc(asset, false),
34-
!lint ? Promise.resolve(undefined) : runEslint(asset, false, false),
34+
!lint ? Promise.resolve(undefined) : runEslint(asset),
3535
];
3636

3737
const [tscResult, lintResult] = await Promise.all(promises);
@@ -64,7 +64,7 @@ export async function runBuilderWithPrebuild<T extends InputAsset, U extends any
6464
export async function runPrebuild(asset: InputAsset) {
6565
const [tscResult, lintResult] = await Promise.all([
6666
runTsc(asset, false),
67-
runEslint(asset, false, false)
67+
runEslint(asset)
6868
]);
6969

7070
return {

lib/buildtools/src/prebuild/lint.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,17 @@ async function timePromise<T>(f: () => Promise<T>) {
4040
};
4141
}
4242

43+
const defaultLintOptions: LintOptions = {
44+
fix: false,
45+
stats: false,
46+
concurrency: 'auto'
47+
}
48+
4349
// #region runEslint
44-
export async function runEslint(input: InputAsset, { fix, stats, concurrency }: LintOptions): Promise<LintResult> {
50+
export async function runEslint(
51+
input: InputAsset,
52+
{ fix, stats, concurrency }: LintOptions = defaultLintOptions
53+
): Promise<LintResult> {
4554
const linter = new ESLint({
4655
fix,
4756
stats,

0 commit comments

Comments
 (0)