Skip to content

Instantly share code, notes, and snippets.

@mrchimp
Created July 10, 2022 15:36
Show Gist options
  • Select an option

  • Save mrchimp/ccb334c626a348d367a30c3126043384 to your computer and use it in GitHub Desktop.

Select an option

Save mrchimp/ccb334c626a348d367a30c3126043384 to your computer and use it in GitHub Desktop.
TypeScript compile error: TS7006: Parameter 'id' implicitly has an 'any' type.
class Foo {
id: string;
constructor(id: string) {
this.id = id;
}
}
{
"name": "test",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"watch": "mix watch"
},
"dependencies": {
"laravel-mix": "^6.0.49"
},
"devDependencies": {
"ts-loader": "^9.3.1",
"typescript": "^4.7.4"
}
}
{
"compilerOptions": {
"target": "esnext",
"useDefineForClassFields": true,
"module": "esnext",
"moduleResolution": "node",
"strict": true,
"jsx": "preserve",
"sourceMap": true,
"resolveJsonModule": true,
"isolatedModules": false,
"esModuleInterop": true,
"experimentalDecorators": true,
"lib": [
"esnext",
"dom"
],
"skipLibCheck": true,
"baseUrl": "resources/js",
"paths": {
"@/*": [ "*" ]
}
},
"include": [
"*.ts"
]
}
const mix = require("laravel-mix");
const path = require("path");
mix.webpackConfig({
resolve: {
extensions: [".vue", ".ts", ".js"],
},
module: {
rules: [
{
test: /\.ts$/,
loader: "ts-loader",
exclude: /node-module/,
options: { appendTsSuffixTo: [/\.vue$/] },
},
],
},
});
mix.ts("app.ts", "public/js");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment