@@ -7,29 +7,44 @@ import { route as ziggyRoute } from 'ziggy-js';
7
7
8
8
const appName = import . meta. env . VITE_APP_NAME || 'Laravel' ;
9
9
10
+ /**
11
+ * Added eslint-disable-next-line @typescript-eslint/ban-ts-comment and @ts-ignore to fix the error.
12
+ * I'm not sure if the fix really leads to a type-safe Javascript.
13
+ */
14
+
10
15
createServer ( ( page ) =>
11
16
createInertiaApp ( {
12
17
page,
13
18
render : renderToString ,
14
19
title : ( title ) => `${ title } - ${ appName } ` ,
20
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
21
+ // @ts -ignore
15
22
resolve : ( name ) => resolvePageComponent ( `./pages/${ name } .vue` , import . meta. glob ( './pages/**/*.vue' ) ) ,
16
23
setup ( { App, props, plugin } ) {
17
24
const app = createSSRApp ( { render : ( ) => h ( App , props ) } ) ;
18
25
19
26
// Configure Ziggy for SSR...
20
27
const ziggyConfig = {
28
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
29
+ // @ts -ignore
21
30
...page . props . ziggy ,
31
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
32
+ // @ts -ignore
22
33
location : new URL ( page . props . ziggy . location ) ,
23
34
} ;
24
35
25
36
// Create route function...
26
37
const route = ( name : string , params ?: any , absolute ?: boolean ) => ziggyRoute ( name , params , absolute , ziggyConfig ) ;
27
38
28
39
// Make route function available globally...
40
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
41
+ // @ts -ignore
29
42
app . config . globalProperties . route = route ;
30
43
31
44
// Make route function available globally for SSR...
32
45
if ( typeof window === 'undefined' ) {
46
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
47
+ // @ts -ignore
33
48
global . route = route ;
34
49
}
35
50
0 commit comments