mirror of
https://github.com/alexgo-io/onekey-monorepo.git
synced 2026-04-29 04:05:14 +08:00
* fix: remove KeyboardManager * fix: fix routes * fix: fix types * fix: fix types * fix: remove unused button * fix: fix warnings * fix: fix types * fix: fix types * Update MAX_WARNINGS_COUNT to 197 in lintCheck.js.
32 lines
838 B
JavaScript
32 lines
838 B
JavaScript
const { execSync } = require('child_process');
|
|
const { exit } = require('process');
|
|
|
|
const MAX_WARNINGS_COUNT = 196;
|
|
|
|
function handleWarnings(result) {
|
|
const warningsCount = result.match(/, (\d+) warnings\)/)?.[1];
|
|
console.log(`Warnings Counts: ${warningsCount}`);
|
|
if (Number(warningsCount) > MAX_WARNINGS_COUNT) {
|
|
console.log(
|
|
`Please do not add more ESLint warnings than ${MAX_WARNINGS_COUNT}`,
|
|
);
|
|
console.log(
|
|
'Hope you can fix the ESLint warings introduced after this merge.',
|
|
);
|
|
exit(1);
|
|
}
|
|
}
|
|
|
|
try {
|
|
const result = execSync(
|
|
`sh -c 'npx eslint . --ext .ts,.tsx --fix --cache --cache-location "$(yarn config get cacheFolder)"'`,
|
|
).toString('utf-8');
|
|
console.log(result);
|
|
handleWarnings(result);
|
|
} catch (error) {
|
|
console.log(error.stdout.toString('utf-8'));
|
|
exit(1);
|
|
}
|
|
|
|
exit(0);
|