IntegerAlex / ts-strict-setup

Variable used before definition JS-0129
Bug risk
Major
4 occurrences in this check
'eslint' was used before it was defined
 74  fs.writeFileSync(path.join(projectPath, 'views', 'index.html'), '')
 75  fs.writeFileSync(path.join(projectPath, 'tsconfig.json'), tsconfig)
 76  fs.writeFileSync(path.join(projectPath, '.eslintignore'), eslintIgnore)
 77  fs.writeFileSync(path.join(projectPath, 'eslint.config.js'), eslint) 78}
 79
 80const tsconfig = `{
'eslintIgnore' was used before it was defined
 73  fs.writeFileSync(path.join(projectPath, 'test', 'index.test.ts'), '')
 74  fs.writeFileSync(path.join(projectPath, 'views', 'index.html'), '')
 75  fs.writeFileSync(path.join(projectPath, 'tsconfig.json'), tsconfig)
 76  fs.writeFileSync(path.join(projectPath, '.eslintignore'), eslintIgnore) 77  fs.writeFileSync(path.join(projectPath, 'eslint.config.js'), eslint)
 78}
 79
'tsconfig' was used before it was defined
 72  fs.writeFileSync(path.join(projectPath, 'src', 'index.ts'), '')
 73  fs.writeFileSync(path.join(projectPath, 'test', 'index.test.ts'), '')
 74  fs.writeFileSync(path.join(projectPath, 'views', 'index.html'), '')
 75  fs.writeFileSync(path.join(projectPath, 'tsconfig.json'), tsconfig) 76  fs.writeFileSync(path.join(projectPath, '.eslintignore'), eslintIgnore)
 77  fs.writeFileSync(path.join(projectPath, 'eslint.config.js'), eslint)
 78}
'packageJson' was used before it was defined
 54
 55function installDependencies (projectName) {
 56  const projectPath = path.join(process.cwd(), projectName)
 57  fs.writeFileSync(path.join(projectPath, 'package.json'), packageJson(projectName)) 58  execSync('npm install', { cwd: projectPath, stdio: 'inherit' })
 59  execSync('npm install --save-dev eslint @eslint/js @types/eslint__js typescript @typescript-eslint/eslint-plugin eslint-define-config ts-node --loglevel=error', { cwd: projectPath, stdio: 'inherit' })
 60}