My code is as follows:
$(function() {
$("table").on("click", function() {
const button = $(this);
});
});
My error is:
this implicitly has type 'any' because it does not have a type annotation.
How do I fix this error?
Edit:
My tsconfig.json is as follows:
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"moduleResolution": "node",
"sourceMap": true,
"strict": true,
"outDir": "dist",
"baseUrl": ".",
"paths": {
"*": [
"node_modules/*",
"src/types/*"
]
}
},
"include": [
"src/**/*"
]
}
Edit 2:
I have the following in my package.json
"@types/jquery": "^2.0.41",
noImplicitAny: truein yourtsconfig.json? - rossipedianpm install --save-dev @types/jquery- kingdaro