Skip to content

Commit c0ac8a3

Browse files
committed
Fix linting issues and exclude templates from ESLint
- Add templates directory to ESLint global ignores - Fix RuboCop style violations with autofix - Ensure all linting passes before PR creation
1 parent 665b7d8 commit c0ac8a3

File tree

2 files changed

+30
-28
lines changed

2 files changed

+30
-28
lines changed

eslint.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ const config = tsEslint.config([
4444
// fixtures
4545
'**/fixtures/',
4646
'**/.yalc/**/*',
47+
// generator templates
48+
'**/templates/**/*',
4749
]),
4850
{
4951
files: ['**/*.[jt]s', '**/*.[jt]sx', '**/*.[cm][jt]s'],

lib/generators/react_on_rails/install_generator.rb

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,15 @@ def install_typescript_dependencies
327327
]
328328

329329
install_command = case package_manager
330-
when "npm"
331-
"npm install --save-dev #{typescript_packages.join(' ')}"
332-
when "yarn"
333-
"yarn add --dev #{typescript_packages.join(' ')}"
334-
when "pnpm"
335-
"pnpm add --save-dev #{typescript_packages.join(' ')}"
336-
when "bun"
337-
"bun add --dev #{typescript_packages.join(' ')}"
338-
end
330+
when "npm"
331+
"npm install --save-dev #{typescript_packages.join(' ')}"
332+
when "yarn"
333+
"yarn add --dev #{typescript_packages.join(' ')}"
334+
when "pnpm"
335+
"pnpm add --save-dev #{typescript_packages.join(' ')}"
336+
when "bun"
337+
"bun add --dev #{typescript_packages.join(' ')}"
338+
end
339339

340340
success = system(install_command)
341341
unless success
@@ -405,30 +405,30 @@ def configure_babel_for_typescript
405405
babel_typescript_package = "@babel/preset-typescript"
406406

407407
install_command = case package_manager
408-
when "npm"
409-
"npm install --save-dev #{babel_typescript_package}"
410-
when "yarn"
411-
"yarn add --dev #{babel_typescript_package}"
412-
when "pnpm"
413-
"pnpm add --save-dev #{babel_typescript_package}"
414-
when "bun"
415-
"bun add --dev #{babel_typescript_package}"
416-
end
408+
when "npm"
409+
"npm install --save-dev #{babel_typescript_package}"
410+
when "yarn"
411+
"yarn add --dev #{babel_typescript_package}"
412+
when "pnpm"
413+
"pnpm add --save-dev #{babel_typescript_package}"
414+
when "bun"
415+
"bun add --dev #{babel_typescript_package}"
416+
end
417417

418418
puts Rainbow("📝 Installing Babel TypeScript preset...").yellow
419419
success = system(install_command)
420-
unless success
421-
warning = <<~MSG.strip
422-
⚠️ Failed to install Babel TypeScript preset automatically.
420+
return if success
423421

424-
Please run manually:
425-
#{install_command}
422+
warning = <<~MSG.strip
423+
⚠️ Failed to install Babel TypeScript preset automatically.
426424
427-
TypeScript compilation may not work without this preset.
428-
MSG
429-
GeneratorMessages.add_warning(warning)
430-
return
431-
end
425+
Please run manually:
426+
#{install_command}
427+
428+
TypeScript compilation may not work without this preset.
429+
MSG
430+
GeneratorMessages.add_warning(warning)
431+
nil
432432
end
433433

434434
# Removed: Shakapacker auto-installation logic (now explicit dependency)

0 commit comments

Comments
 (0)