IntegerAlex / ts-strict-setup

Variable used before definition JS-0129
Bug risk
Major
6 occurrences in this check
'eslint' was used before it was defined
 82  fs.writeFileSync(path.join(projectPath, "views", "index.html"), indexHtml);
 83  fs.writeFileSync(path.join(projectPath, "tsconfig.json"), tsconfig);
 84  fs.writeFileSync(path.join(projectPath, ".eslintignore"), eslintIgnore);
 85  fs.writeFileSync(path.join(projectPath, "eslint.config.js"), eslint); 86}
 87
 88const tsconfig = `{
'eslintIgnore' was used before it was defined
 81  fs.writeFileSync(path.join(projectPath, "test", "index.test.ts"), "");
 82  fs.writeFileSync(path.join(projectPath, "views", "index.html"), indexHtml);
 83  fs.writeFileSync(path.join(projectPath, "tsconfig.json"), tsconfig);
 84  fs.writeFileSync(path.join(projectPath, ".eslintignore"), eslintIgnore); 85  fs.writeFileSync(path.join(projectPath, "eslint.config.js"), eslint);
 86}
 87
'tsconfig' was used before it was defined
 80  fs.writeFileSync(path.join(projectPath, "src", "index.ts"), serve);
 81  fs.writeFileSync(path.join(projectPath, "test", "index.test.ts"), "");
 82  fs.writeFileSync(path.join(projectPath, "views", "index.html"), indexHtml);
 83  fs.writeFileSync(path.join(projectPath, "tsconfig.json"), tsconfig); 84  fs.writeFileSync(path.join(projectPath, ".eslintignore"), eslintIgnore);
 85  fs.writeFileSync(path.join(projectPath, "eslint.config.js"), eslint);
 86}
'indexHtml' was used before it was defined
 79  const projectPath = path.join(process.cwd(), projectName);
 80  fs.writeFileSync(path.join(projectPath, "src", "index.ts"), serve);
 81  fs.writeFileSync(path.join(projectPath, "test", "index.test.ts"), "");
 82  fs.writeFileSync(path.join(projectPath, "views", "index.html"), indexHtml); 83  fs.writeFileSync(path.join(projectPath, "tsconfig.json"), tsconfig);
 84  fs.writeFileSync(path.join(projectPath, ".eslintignore"), eslintIgnore);
 85  fs.writeFileSync(path.join(projectPath, "eslint.config.js"), eslint);
'serve' was used before it was defined
 77
 78function createFiles(projectName) {
 79  const projectPath = path.join(process.cwd(), projectName);
 80  fs.writeFileSync(path.join(projectPath, "src", "index.ts"), serve); 81  fs.writeFileSync(path.join(projectPath, "test", "index.test.ts"), "");
 82  fs.writeFileSync(path.join(projectPath, "views", "index.html"), indexHtml);
 83  fs.writeFileSync(path.join(projectPath, "tsconfig.json"), tsconfig);
'packageJson' was used before it was defined
 58  const projectPath = path.join(process.cwd(), projectName);
 59  fs.writeFileSync(
 60    path.join(projectPath, "package.json"),
 61    packageJson(projectName), 62  );
 63  execSync("npm install", { cwd: projectPath, stdio: "inherit" });
 64  execSync(