Skip to content

Commit

Permalink
add eslint option for inertia stack
Browse files Browse the repository at this point in the history
  • Loading branch information
avosalmon committed Oct 3, 2024
1 parent 04d17c5 commit d6fff66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/NewCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ protected function configure()
->addOption('jet', null, InputOption::VALUE_NONE, 'Installs the Laravel Jetstream scaffolding')
->addOption('dark', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with dark mode support')
->addOption('typescript', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with TypeScript support')
->addOption('eslint', null, InputOption::VALUE_NONE, 'Indicate whether Breeze should be scaffolded with ESLint and Prettier support')
->addOption('ssr', null, InputOption::VALUE_NONE, 'Indicate whether Breeze or Jetstream should be scaffolded with Inertia SSR support')
->addOption('api', null, InputOption::VALUE_NONE, 'Indicates whether Jetstream should be scaffolded with API support')
->addOption('teams', null, InputOption::VALUE_NONE, 'Indicates whether Jetstream should be scaffolded with team support')
Expand Down Expand Up @@ -430,12 +431,13 @@ protected function installBreeze(string $directory, InputInterface $input, Outpu
$commands = array_filter([
$this->findComposer().' require laravel/breeze --dev',
trim(sprintf(
$this->phpBinary().' artisan breeze:install %s %s %s %s %s',
$this->phpBinary().' artisan breeze:install %s %s %s %s %s %s',
$input->getOption('stack'),
$input->getOption('typescript') ? '--typescript' : '',
$input->getOption('pest') ? '--pest' : '',
$input->getOption('dark') ? '--dark' : '',
$input->getOption('ssr') ? '--ssr' : '',
$input->getOption('eslint') ? '--eslint' : '',
)),
]);

Expand Down Expand Up @@ -552,11 +554,13 @@ protected function promptForBreezeOptions(InputInterface $input)
'dark' => 'Dark mode',
'ssr' => 'Inertia SSR',
'typescript' => 'TypeScript',
'eslint' => 'ESLint with Prettier',
],
default: array_filter([
$input->getOption('dark') ? 'dark' : null,
$input->getOption('ssr') ? 'ssr' : null,
$input->getOption('typescript') ? 'typescript' : null,
$input->getOption('eslint') ? 'eslint' : null,
]),
))->each(fn ($option) => $input->setOption($option, true));
} elseif (in_array($input->getOption('stack'), ['blade', 'livewire', 'livewire-functional']) && ! $input->getOption('dark')) {
Expand Down

0 comments on commit d6fff66

Please sign in to comment.