簡體   English   中英

ESLint找不到插件“ eslint-plugin-angular”,但我沒有使用Angular

[英]ESLint couldn't find the plugin “eslint-plugin-angular” but i'm not using Angular

我正在使用ES6開發一個React應用程序。 該應用程序是使用create-react-app包裝器create-react-app

我正在為該應用程序設置ESLint,但出現錯誤ESLint couldn't find the plugin eslint-plugin-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"
  ]
}

你們以前有這個問題嗎?

謝謝

看來這可能是一個類似的問題 您的用戶文件夾中是否有一個.eslinrc? 您可以嘗試將其刪除或在全球范圍內安裝插件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM