gpt4 book ai didi

javascript - ESLint 找不到插件 "eslint-plugin-angular"但我没有使用 Angular

转载 作者:行者123 更新时间:2023-11-30 15:32:57 25 4
gpt4 key购买 nike

我正在使用 ES6 开发 React 应用程序。该应用程序是使用 create-react-app 包装器创建的。

我正在为该应用程序设置 ESLint,但出现错误 ESLint 找不到插件 eslint-plugin-angular。据我所知,我没有在任何地方使用 Angular。你遇到过这样的错误吗?

可能是出于某种我没有考虑的原因需要 Angular 插件吗?

这是我的package.json

{
"name": "app",
"version": "0.1.0",
"private": true,
"repository": {
"type": "git",
"url": "repo"
},
"devDependencies": {
"autoprefixer": "6.5.1",
"axios-mock-adapter": "^1.7.1",
"babel-core": "6.17.0",
"babel-eslint": "7.1.1",
"babel-jest": "17.0.2",
"babel-loader": "6.2.7",
"babel-preset-react-app": "^2.0.1",
"case-sensitive-paths-webpack-plugin": "1.1.4",
"chalk": "1.1.3",
"connect-history-api-fallback": "1.3.0",
"cross-spawn": "4.0.2",
"css-loader": "0.26.0",
"detect-port": "1.0.1",
"dotenv": "^4.0.0",
"enzyme": "^2.7.0",
"eslint": "3.8.1",
"eslint-config-react-app": "^0.5.0",
"eslint-loader": "1.6.0",
"eslint-plugin-flowtype": "2.21.0",
"eslint-plugin-import": "2.0.1",
"eslint-plugin-jsx-a11y": "2.2.3",
"eslint-plugin-react": "6.4.1",
"extract-text-webpack-plugin": "1.0.1",
"file-loader": "0.9.0",
"filesize": "3.3.0",
"fs-extra": "0.30.0",
"gzip-size": "3.0.0",
"html-webpack-plugin": "2.24.0",
"http-proxy-middleware": "0.17.2",
"jest": "17.0.2",
"json-loader": "0.5.4",
"node-sass": "^4.0.0",
"object-assign": "4.1.0",
"path-exists": "2.1.0",
"postcss-loader": "1.0.0",
"promise": "7.1.1",
"react-addons-test-utils": "^15.4.1",
"react-dev-utils": "^0.4.2",
"react-test-renderer": "^15.4.1",
"recursive-readdir": "2.1.0",
"redux-mock-store": "^1.2.1",
"sass-loader": "^4.1.0",
"sinon": "^1.17.7",
"socket.io": "^1.7.2",
"strip-ansi": "3.0.1",
"style-loader": "0.13.1",
"url-loader": "0.5.7",
"webpack": "1.14.0",
"webpack-dev-server": "1.16.2",
"webpack-manifest-plugin": "1.1.0",
"whatwg-fetch": "1.0.0"
},
"dependencies": {
"axios": "^0.15.3",
"font-awesome": "^4.7.0",
"immutable": "^3.8.1",
"inuitcss": "^6.0.0-beta.4",
"react": "^15.4.1",
"react-dom": "^15.4.1",
"react-redux": "^5.0.0",
"react-router": "^3.0.0",
"redux": "^3.6.0",
"redux-thunk": "^2.1.0",
"socket.io-client": "^1.7.2"
},
"scripts": {
"start": "node scripts/start.js",
"build": "node scripts/build.js",
"test": "NODE_ENV=test node scripts/test.js --env=jsdom"
},
"jest": {
"collectCoverageFrom": [
"src/**/*.{js,jsx}"
],
"setupFiles": [
"<rootDir>/config/polyfills.js"
],
"testPathIgnorePatterns": [
"<rootDir>[/\\\\](build|docs|node_modules)[/\\\\]"
],
"testEnvironment": "node",
"testURL": "http://localhost",
"transform": {
"^.+\\.(js|jsx)$": "<rootDir>/node_modules/babel-jest",
"^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
"^(?!.*\\.(js|jsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
},
"transformIgnorePatterns": [
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx)$"
],
"moduleNameMapper": {
"^react-native$": "react-native-web"
}
}
}

这是我的.eslintrc.json

{
"env": {
"browser": true,
"es6": true,
"jest": true
},
"extends": ["eslint:recommended", "plugin:react/recommended"],
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"never"
]
}
}

还有我的babel.rc 文件

{
"presets": [
"react-app"
]
}

你们以前遇到过这个问题吗?

谢谢

最佳答案

看起来像this might be a similar problem .您的用户文件夹中是否有 .eslinrc?您可以尝试删除它或全局安装插件。

关于javascript - ESLint 找不到插件 "eslint-plugin-angular"但我没有使用 Angular,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41983424/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com