mirror of
https://github.com/alexgo-io/onekey-monorepo.git
synced 2026-04-30 12:42:02 +08:00
chore: lower the error and warning limit (#3823)
* Update tsCheck.js * Update lintCheck.js
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const { execSync } = require('child_process');
|
||||
const { exit } = require('process');
|
||||
|
||||
const MAX_WARNINGS_COUNT = 300;
|
||||
const MAX_WARNINGS_COUNT = 197;
|
||||
|
||||
function handleWarnings(result) {
|
||||
const warningsCount = result.match(/, (\d+) warnings\)/)?.[1];
|
||||
|
||||
@@ -1,31 +1,5 @@
|
||||
const { execSync } = require('child_process');
|
||||
const { exit } = require('process');
|
||||
|
||||
const MAX_ERROR_COUNT = 58;
|
||||
|
||||
try {
|
||||
execSync(
|
||||
`sh -c 'npx tsc --noEmit --tsBuildInfoFile \"$(yarn config get cacheFolder)\"/.app-mono-ts-cache --pretty'`,
|
||||
);
|
||||
} catch (error) {
|
||||
const result = error.stdout.toString('utf-8');
|
||||
console.log(result);
|
||||
if (result.includes('packages/components')) {
|
||||
console.error('\n\n\n');
|
||||
console.error('Please do not add errors in packages/components');
|
||||
exit(1);
|
||||
}
|
||||
|
||||
const errorCount = result.match(/Found (\d+) errors in/)?.[1];
|
||||
if (errorCount > MAX_ERROR_COUNT) {
|
||||
console.error('\n\n\n');
|
||||
console.error(`Error count: ${errorCount}`);
|
||||
console.error(`Please do not add more errors than ${MAX_ERROR_COUNT}`);
|
||||
console.error(
|
||||
'Hope you can fix the ts errors introduced after this merge.',
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
exit(0);
|
||||
execSync(
|
||||
`sh -c 'npx tsc --noEmit --tsBuildInfoFile \"$(yarn config get cacheFolder)\"/.app-mono-ts-cache --pretty'`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user