Spfx React project Tslint Warning error no-unused-expression: unused expression, expected an assign

New Contributor

In a Spfx project with React components, the Tslint shows warning on all "if" statements, 

"error no-unused-expression: unused expression, expected an assignment or function call". I am sure that the if statement is valid as the same code runs fine on other project. does anyone has any suggestions? I can disable the rule to avoid the warning, but I don't think that it's a good solution.

 

thanks a lot

 

here is my package.json file 

"

"dependencies": {
    "@microsoft/rush-stack-compiler-3.3": "^0.2.22",
    "@microsoft/sp-core-library": "1.8.0",
    "@microsoft/sp-lodash-subset": "1.8.0",
    "@microsoft/sp-office-ui-fabric-core": "^1.8.2",
    "@microsoft/sp-property-pane": "1.8.0",
    "@microsoft/sp-webpart-base": "1.8.0",
    "@pnp/spfx-controls-react": "1.13.2",
    "@pnp/spfx-property-controls": "1.16.0",
    "@types/es6-promise": "0.0.33",
    "@types/react": "16.4.2",
    "@types/react-bootstrap": "^0.32.19",
    "@types/react-dom": "16.0.5",
    "@types/webpack-env": "1.13.1",
    "office-ui-fabric-react": "^7.8.1",
    "react": "16.7.0",
    "react-autocomplete": "^1.8.1",
    "react-autosuggest": "^9.4.3",
    "react-bootstrap": "^1.0.0-beta.10",
    "react-dom": "16.7.0",
    "throttle-debounce": "^2.1.0",
    "tslint": "^5.18.0",
    "typescript": "^3.5.2"
  },
"
0 Replies