[Dev] Turned on checkJs in TSConfig; fixed script type errors (#6115)

This commit is contained in:
Bertie690 2025-07-27 16:42:57 -04:00 committed by GitHub
parent 7cb2c560ab
commit 29d9bb6e7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 14 deletions

View File

@ -177,9 +177,10 @@
}
},
// Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes)
// Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes),
// as well as in all TS files in `scripts/` (which are assumed to be boilerplate templates).
{
"includes": ["**/src/overrides.ts", "**/src/enums/**/*"],
"includes": ["**/src/overrides.ts", "**/src/enums/**/*", "**/scripts/**/*.ts"],
"linter": {
"rules": {
"correctness": {
@ -189,7 +190,7 @@
}
},
{
"includes": ["**/src/overrides.ts"],
"includes": ["**/src/overrides.ts", "**/scripts/**/*.ts"],
"linter": {
"rules": {
"style": {

View File

@ -44,20 +44,22 @@ function getTestFolderPath(...folders) {
* @returns {Promise<{selectedOption: {label: string, dir: string}}>} the selected type
*/
async function promptTestType() {
const typeAnswer = await inquirer.prompt([
{
type: "list",
name: "selectedOption",
message: "What type of test would you like to create?",
choices: [...choices.map(choice => ({ name: choice.label, value: choice })), "EXIT"],
},
]);
const typeAnswer = await inquirer
.prompt([
{
type: "list",
name: "selectedOption",
message: "What type of test would you like to create?",
choices: [...choices.map(choice => ({ name: choice.label, value: choice })), { name: "EXIT", value: "N/A" }],
},
])
.then(ans => ans.selectedOption);
if (typeAnswer.selectedOption === "EXIT") {
if (typeAnswer.name === "EXIT") {
console.log("Exiting...");
return process.exit();
return process.exit(0);
}
if (!choices.some(choice => choice.dir === typeAnswer.selectedOption.dir)) {
if (!choices.some(choice => choice.dir === typeAnswer.dir)) {
console.error(`Please provide a valid type: (${choices.map(choice => choice.label).join(", ")})!`);
return await promptTestType();
}

View File

@ -18,6 +18,7 @@
"esModuleInterop": true,
"strictNullChecks": true,
"sourceMap": false,
"checkJs": true,
"strict": false, // TODO: Enable this eventually
"rootDir": ".",
"baseUrl": "./src",