How to properly configure laravel + inertia + react + typescript?
I have tried to configure these by reading stuff from multiple places. It is working fine except for one place.
I am not getting any type hint on react hooks.
tsconfig
{
"compilerOptions": {
/* Language and Environment */
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
"lib": [
"dom",
"dom.iterable",
"esnext"
] /* Specify a set of bundled library declaration files that describe the target runtime environment. */,
"jsx": "react" /* Specify what JSX code is generated. */,
/* Modules */
"module": "ES2022" /* Specify what module code is generated. */,
"moduleResolution": "Node" /* Specify how TypeScript looks up a file from a given module specifier. */,
"types": [
"vite/client"
] /* Specify type package names to be included without being referenced in a source file. */,
"resolveJsonModule": true /* Enable importing .json files. */,
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
/* Type Checking */
"strict": true /* Enable all strict type-checking options. */,
"noImplicitAny": false /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
"skipLibCheck": true /* Skip type checking all .d.ts files. */,
"paths": {
"@/*": ["./resources/js/*"]
}
}
}