Issues with function args in Typescript types
Answered
"use php" posted this in #help-forum
Answered by "use php"
So, based on this stackoverflow link: https://stackoverflow.com/questions/68802881/get-rid-of-is-defined-but-never-used-in-function-parameter
I found a comment
This helped me solve the issue by extending
I found a comment
You need to use the TypeScript version of the rule, ESLint's rules aren't aware of types
This helped me solve the issue by extending
typescript-eslint.28 Replies
-# .eslintsrc.js
const path = require("path")
module.exports = {
"root": true,
"extends": [
"eslint:recommended",
"next/core-web-vitals",
"plugin:eslint-plugin-next-on-pages/recommended",
"plugin:tailwindcss/recommended",
"next",
"prettier",
],
settings: {
tailwindcss: {
config: path.join(__dirname, './tailwind.config.ts'),
},
},
"plugins": [
"eslint-plugin-next-on-pages"
]
}@"use php" I'm getting this error, How do I fix it?
I believe its something relating to eslint
Yellowstripe scad
Quick google search for how to remove no unused vars eslint should help you out
@Yellowstripe scad Quick google search for how to remove no unused vars eslint should help you out
Do you expect to type this every time?
//disable…
I already know that. I asked this question to remove this warning
Yellowstripe scad
No, in your eslint config file
i only have this
{
"extends": "next/core-web-vitals",
"rules": {
"@next/next/no-img-element": "off"
}
}i dont get no-unused-vars error with this config
@Yellowstripe scad No, in your eslint config file
I don’t want to disable it
Issue is I’m getting this warning in ts types
@gin why is your eslint so advanced
To be able to see all my errors like u used variables
bump
@"use php" bump
Blue Picardy Spaniel
just don't declare the variable?
@Blue Picardy Spaniel just don't declare the variable?
I'll get a warning in my code then
Blue Picardy Spaniel
saying what
Blue Picardy Spaniel
paste the code that's having issues
interface PopupContentProps {
onClick: (state: string) => void;
}I'm getting warning on state
thats the min repro
Blue Picardy Spaniel
Will try this soon
Blue Picardy Spaniel
@"use php" do you still need the link?
No, found it
So, based on this stackoverflow link: https://stackoverflow.com/questions/68802881/get-rid-of-is-defined-but-never-used-in-function-parameter
I found a comment
This helped me solve the issue by extending
I found a comment
You need to use the TypeScript version of the rule, ESLint's rules aren't aware of types
This helped me solve the issue by extending
typescript-eslint.Answer