找不到规则'@ typescript-eslint/no-redeclare'的定义 [英] Definition for rule '@typescript-eslint/no-redeclare' was not found
本文介绍了找不到规则'@ typescript-eslint/no-redeclare'的定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在我的所有 .ts
或 .tsx
文件中,我都会在文件的第一个字符上发出此警告,如以下屏幕截图所示:
In all my .ts
or .tsx
files I have this warning on the first character in the file like in the screenshot below:
我正在使用标准的CRA设置.这是我的 package.json
:
I'm using a standard CRA setup. Here's my package.json
:
{
"name": "my-project",
"version": "0.1.0",
"private": true,
"dependencies": {
"firebase": "^8.0.1",
"formik": "^2.2.3",
"i18next": "^19.8.3",
"i18next-browser-languagedetector": "^6.0.1",
"i18next-xhr-backend": "^3.2.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-firebaseui": "^4.1.0",
"react-i18next": "^11.7.3",
"react-router-dom": "^5.2.0",
"react-scripts": "^4.0.0",
"react-select": "^3.1.0",
"react-spinners": "^0.9.0",
"react-syntax-highlighter": "^15.3.0",
"react-transition-group": "^4.4.1",
"styled-components": "^5.2.1",
"yup": "^0.29.3"
},
"devDependencies": {
"@cypress/webpack-preprocessor": "^5.4.10",
"@types/firebase": "^3.2.1",
"@types/jest": "^26.0.15",
"@types/react": "^16.9.56",
"@types/react-dom": "^16.9.9",
"@types/react-router-dom": "^5.1.6",
"@types/react-select": "^3.0.23",
"@types/react-syntax-highlighter": "^13.5.0",
"@types/styled-components": "^5.1.4",
"@types/yup": "^0.29.9",
"cypress": "^5.5.0",
"eslint-plugin-cypress": "^2.11.2",
"i18next-parser": "^3.3.0",
"typescript": "^4.0.5"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"eject": "react-scripts eject",
"cypress:open": "cypress open",
"test": "react-scripts test --runInBand",
"extract": "i18next --config i18next-parser.config.js"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": [
">0.2%",
"not dead",
"not ie <= 11",
"not op_mini all"
]
}
和我的 tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react",
"types": ["cypress"],
"noFallthroughCasesInSwitch": true
},
"include": [
"src"
]
}
知道我缺少什么吗?
推荐答案
当我看到相同的错误时,我最近更新了对项目的依赖关系.只需重新启动Visual Code即可消除该错误.
I had recently updated my dependencies on my project when I saw this same error. A simple restart of Visual Code appears to have eliminated the error.
这篇关于找不到规则'@ typescript-eslint/no-redeclare'的定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文