Home > Software design >  Single type parameter T should have a trailing comma. Example usage: <T,>
Single type parameter T should have a trailing comma. Example usage: <T,>

Time:03-19

Single type parameter T should have a trailing comma. Example usage: <T,>. (3:29)

export const toggleItem = <T>(

How to turn of this error? If I add a <T,> prettier removes the "," on save. I have no change in the package.json, have deleted node_modules and package-lock.json file. Hope somebody can point me in the right direction to what I can do to fix this?

Node v16.14.1 NPM 8.5.4

"@babel/core": "7.14.3",
"@babel/plugin-proposal-class-properties": "7.13.0",
"@babel/preset-env": "7.14.4",
"@babel/preset-react": "7.13.13",
"@babel/preset-typescript": "7.13.0",
"@emotion/babel-preset-css-prop": "11.2.0",
"@emotion/eslint-plugin": "11.2.0",
"@types/hammerjs": "2.0.39",
"@types/node": "15.6.1",
"@types/page": "1.11.2",
"@types/react": "17.0.9",
"@types/react-datepicker": "4.3.4",
"@types/react-dom": "17.0.6",
"@types/signalr": "2.2.36",
"@typescript-eslint/eslint-plugin": "4.26.0",
"@typescript-eslint/parser": "4.26.0",
"eslint": "7.27.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-filenames": "1.3.2",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-normatic": "file:eslint",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-promise": "5.1.0",
"eslint-plugin-react": "7.24.0",
"eslint-plugin-react-hooks": "4.2.0",
"eslint-rule-composer": "0.3.0",

CodePudding user response:

Thanks to T.J.Crowder for help. I change the file extension to .jsx and change the function to use "ANY" and not the "T".

CodePudding user response:

I got the same problem here and I don't think this should be a tsx file as it does not contain any JSX...

  • Related