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:
		@ -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]:'),
 | 
			
		||||
 | 
			
		||||
@ -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);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user