Utilizing the HeadersInit
type in my react/typescript project has posed a challenge. ESLint seems to believe that the type is undefined:
https://i.sstatic.net/LPcRf.png
However, it is evident that TypeScript recognizes what HeadersInit
entails. Upon further inspection, the type definition can be traced back to the standard typescript library.
https://i.sstatic.net/QpmGJ.png
Why does ESLint raise concerns when TypeScript has a clear understanding?
Here's a snippet of my eslintrc configuration:
{
"extends": [
"eslint:recommended",
"next/core-web-vitals",
"prettier",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"plugins": ["react", "prettier", "@typescript-eslint"],
"overrides": [
{
"files": ["**/*.spec.ts", "**/*.spec.tsx", "**/*.test.tsx"],
"env": {
"jest": true
}
}
]
}
Here are the package versions I am using:
"@typescript-eslint/eslint-plugin": "^5.62.0",
"eslint": "^8.38.0",
"eslint-config-next": "^13.3.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-jest-dom": "^4.0.3",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-testing-library": "^5.10.3",
"typescript": "5.0.4"