eslint not showing the error sign when it is supposed to

Issue

This Content is from Stack Overflow. Question asked by pravin poudel

I am in react project and have typescriot in it.

I create react project with typescript by command

npx create-react-app my-app --template typescript

It working properly which mean i do npm start, it start the starting react page !!

I wanted to add a component and this is my component

import React, { useState } from "react";

interface Person {
  firstname: string;
  lastName: string;
}
interface Props {
  text: string;
  ok?: boolean;
  i?: number;
  fn: (bob: string) => number;
  obj: Person;
}

export const TextField: React.FC<Props> = () => {
  const [count, setCount] = useState<number | null>(5);
  setCount(undefined);
  return (
    <div>
      <input />
    </div>
  );
};

my problem with this code:

enter image description here

Why is my eslint not showing any error or warning !!

this is my package.json:

{
  "name": "shadow-casting",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "@types/jest": "^27.5.2",
    "@types/node": "^16.11.59",
    "@types/react": "^18.0.20",
    "@types/react-dom": "^18.0.6",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
    "typescript": "^4.8.3",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Thank you !!



Solution

This question is not yet answered, be the first one who answer using the comment. Later the confirmed answer will be published as the solution.

This Question and Answer are collected from stackoverflow and tested by JTuto community, is licensed under the terms of CC BY-SA 2.5. - CC BY-SA 3.0. - CC BY-SA 4.0.

people found this article helpful. What about you?