Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.x] Remove unnecessary Ziggy parameter which causes ESLint errors #1347

Merged
merged 1 commit into from
Jul 28, 2023
Merged

[3.x] Remove unnecessary Ziggy parameter which causes ESLint errors #1347

merged 1 commit into from
Jul 28, 2023

Conversation

Smef
Copy link
Contributor

@Smef Smef commented Jul 28, 2023

Using the additional Ziggy parameter with .use(ZiggyVue, Ziggy) is unnecessary when using the @routes Blade directive. Leaving this in (accurately) triggers an ESLint error ESLint: 'Ziggy' is not defined.(no-undef) since Ziggy is undefined in this context.

Since this additional parameter isn't necessary as the @routes blade directive is already being used, it should be removed to avoid triggering errors when using ESLint.

Alternatively, we could add const { Ziggy } = window or change the parameter to window.Ziggy, but this is all unnecessary and removing it seems to be the simplest, cleanest solution.

See Ziggy Docs for more information

Note: If you use the @routes Blade directive in your views, Ziggy's configuration will already be available globally, so you don't need to import the Ziggy config object and pass it into use().

@taylorotwell taylorotwell merged commit d9e2dbf into laravel:3.x Jul 28, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants