mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-06 23:49:26 +02:00
[Dev] Turned on checkJs
in TSConfig; fixed script type errors (#6115)
This commit is contained in:
parent
7cb2c560ab
commit
29d9bb6e7b
@ -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": {
|
"linter": {
|
||||||
"rules": {
|
"rules": {
|
||||||
"correctness": {
|
"correctness": {
|
||||||
@ -189,7 +190,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"includes": ["**/src/overrides.ts"],
|
"includes": ["**/src/overrides.ts", "**/scripts/**/*.ts"],
|
||||||
"linter": {
|
"linter": {
|
||||||
"rules": {
|
"rules": {
|
||||||
"style": {
|
"style": {
|
||||||
|
@ -44,20 +44,22 @@ function getTestFolderPath(...folders) {
|
|||||||
* @returns {Promise<{selectedOption: {label: string, dir: string}}>} the selected type
|
* @returns {Promise<{selectedOption: {label: string, dir: string}}>} the selected type
|
||||||
*/
|
*/
|
||||||
async function promptTestType() {
|
async function promptTestType() {
|
||||||
const typeAnswer = await inquirer.prompt([
|
const typeAnswer = await inquirer
|
||||||
{
|
.prompt([
|
||||||
type: "list",
|
{
|
||||||
name: "selectedOption",
|
type: "list",
|
||||||
message: "What type of test would you like to create?",
|
name: "selectedOption",
|
||||||
choices: [...choices.map(choice => ({ name: choice.label, value: choice })), "EXIT"],
|
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...");
|
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(", ")})!`);
|
console.error(`Please provide a valid type: (${choices.map(choice => choice.label).join(", ")})!`);
|
||||||
return await promptTestType();
|
return await promptTestType();
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"strictNullChecks": true,
|
"strictNullChecks": true,
|
||||||
"sourceMap": false,
|
"sourceMap": false,
|
||||||
|
"checkJs": true,
|
||||||
"strict": false, // TODO: Enable this eventually
|
"strict": false, // TODO: Enable this eventually
|
||||||
"rootDir": ".",
|
"rootDir": ".",
|
||||||
"baseUrl": "./src",
|
"baseUrl": "./src",
|
||||||
|
Loading…
Reference in New Issue
Block a user