forked from davidje13/Refacto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlint.mjs
executable file
·39 lines (33 loc) · 1009 Bytes
/
lint.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env node
import { join } from 'node:path';
import { basedir, log } from './helpers/io.mjs';
import { runMultipleTasks } from './helpers/proc.mjs';
const packages = ['frontend', 'backend', 'e2e'];
log('Linting...');
const prettierArgs = ['--check', '.'];
const tscArgs = [];
if (process.stdout.isTTY) {
tscArgs.push('--pretty');
}
await runMultipleTasks(
packages.flatMap((pkg) => [
{
command: join(basedir, pkg, 'node_modules', '.bin', 'tsc'),
args: tscArgs,
cwd: join(basedir, pkg),
outputMode: 'fail_atomic',
successMessage: `Lint ${pkg} (tsc) passed`,
failureMessage: `Lint ${pkg} (tsc) failed`,
},
{
command: join(basedir, pkg, 'node_modules', '.bin', 'prettier'),
args: prettierArgs,
cwd: join(basedir, pkg),
outputMode: 'fail_atomic',
successMessage: `Lint ${pkg} (prettier) passed`,
failureMessage: `Lint ${pkg} (prettier) failed`,
},
]),
{ parallel: true },
);
log('Linting successful');