build: open ts strict check (#279)

* feat: no check lib dir

* feat: open strict check to src dir

* test: update test tsconfig.json

* feat: remove any type

* feat: do not export AbstractParseTreeVisitor

* feat: export StmtContextType as enum

* build: improve antlr4 script
This commit is contained in:
Hayden
2024-03-27 19:04:16 +08:00
committed by GitHub
parent bb0fad1dbe
commit c6615aecac
77 changed files with 439 additions and 349 deletions

View File

@ -67,9 +67,16 @@ function main() {
});
} else if (argv.lang) {
// compile single: yarn antlr4 --lang=mysql
const supportedLanguage = languageEntries.some((language) => language === argv.lang);
if (supportedLanguage) {
compile(argv.lang);
const supportedLanguage = languageEntries.find((language) =>
language.startsWith(argv.lang)
);
if (argv.lang === 'all') {
languageEntries.forEach((language) => {
compile(language);
});
} else if (supportedLanguage) {
compile(supportedLanguage);
} else {
console.error(
chalk.bold.red('\n[Invalid language]:'),

View File

@ -19,7 +19,9 @@ function processFile(filePath) {
if (slices.length !== 2) return;
firstLineContent = `// Generated from dt-sql-parser/src/grammar/` + slices[1];
fs.writeFileSync(filePath, firstLineContent + restContent, 'utf-8');
const tsNoCheckComment = '\n\n// @ts-nocheck';
fs.writeFileSync(filePath, firstLineContent + tsNoCheckComment + restContent, 'utf-8');
} catch (error) {
console.error(error);
}