Your IDE thinks @json(...) is a JavaScript decorator (which only works in TS), but in Blade it’s just a server-side shortcut that Laravel turns into real JSON before sending to the browser.
Fixes
Ignore the red squiggles - Blade will compile it correctly.
Tell you editor "*.blade.php = Blade" (or Install a Blade extension).
Or Swap to PHP's json_encode if you prefer
php
roles: {!! json_encode($roles) !!},