chore: lower the error and warning limit (#3823)

* Update tsCheck.js

* Update lintCheck.js
This commit is contained in:
huhuanming
2023-11-17 09:22:49 +08:00
committed by GitHub
parent 0350698bfc
commit 3527691a7e
2 changed files with 4 additions and 30 deletions

View File

@@ -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];

View File

@@ -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'`,
);