• <dd id="3gzlp"></dd>

    <li id="3gzlp"><acronym id="3gzlp"></acronym></li>

    <span id="3gzlp"></span>

    Line 1:1: Definition for rule 'prettier/prettier' was not found prettier/prettier

    宇宙蒙面俠X 發布于 06/12 23:34
    閱讀 29
    收藏 0

    面對海量數據,你能否從容應對?>>>

    使用  create-react-app 新建項目 ,npm run build 的時候報錯

    Creating an optimized production build...
    Failed to compile.
    
    ./src/actions/global.action.ts
      Line 1:1:  Definition for rule 'prettier/prettier' was not found  prettier/prettier
    
    Search for the keywords to learn more about each error.
    
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! cloud-manager-frontend@0.1.0 build: `react-app-rewired build`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the cloud-manager-frontend@0.1.0 build script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\wuyj\AppData\Roaming\npm-cache\_logs\2020-06-12T15_26_36_980Z-debug.log

    package.json

    {
      "name": "cloud-manager-frontend",
      "version": "0.1.0",
      "private": true,
      "dependencies": {
        "@testing-library/jest-dom": "^4.2.4",
        "@testing-library/react": "^9.3.2",
        "@testing-library/user-event": "^7.1.2",
        "antd": "^4.1.0",
        "axios": "^0.19.0",
        "driver.js": "^0.9.8",
        "mockjs": "^1.1.0",
        "react": "^16.13.1",
        "react-dom": "^16.13.1",
        "react-hook-form": "^4.8.0",
        "react-intl": "^3.11.0",
        "react-redux": "^7.1.3",
        "react-router": "^6.0.0-alpha.3",
        "react-router-dom": "^6.0.0-alpha.3",
        "react-scripts": "^3.4.0",
        "recharts": "^2.0.0-beta.1",
        "redux": "^4.0.5",
        "redux-thunk": "^2.3.0",
        "styled-components": "^4.4.1",
        "typescript": "~3.7.5"
      },
      "scripts": {
        "start": "react-app-rewired start",
        "build": "react-app-rewired build",
        "test": "react-app-rewired test",
        "lint": "tsc --noEmit && eslint '*/**/*.{js,ts,tsx}' --quiet --fix",
        "analyze": "source-map-explorer 'build/static/js/*.js'"
      },
      "browserslist": {
        "production": [
          ">0.2%",
          "not dead",
          "not op_mini all"
        ],
        "development": [
          "last 1 chrome version",
          "last 1 firefox version",
          "last 1 safari version"
        ]
      },
      "devDependencies": {
        "@types/http-proxy-middleware": "^0.19.3",
        "@types/jest": "^24.0.0",
        "@types/mockjs": "^1.0.2",
        "@types/node": "^12.0.0",
        "@types/react": "^16.9.0",
        "@types/react-dom": "^16.9.0",
        "@types/react-redux": "^7.1.5",
        "@types/recharts": "^1.8.5",
        "@types/styled-components": "^4.4.1",
        "@types/webpack-env": "^1.15.0",
        "antd-theme-webpack-plugin": "^1.3.1",
        "babel-plugin-import": "^1.13.0",
        "babel-plugin-recharts": "^1.2.0",
        "customize-cra": "^0.9.1",
        "eslint-config-prettier": "^6.9.0",
        "eslint-plugin-prettier": "^3.1.2",
        "eslint-plugin-react": "^7.18.0",
        "eslint-plugin-react-hooks": "^3.0.0",
        "http-proxy-middleware": "^0.20.0",
        "less": "^3.11.1",
        "less-loader": "^5.0.0",
        "prettier": "^1.19.1",
        "react-app-rewired": "^2.1.5",
        "redux-devtools-extension": "^2.13.8",
        "webpack-bundle-analyzer": "^3.6.0"
      }
    }
    

    .eslintrc

    {
      "extends": [
        "plugin:react/recommended",
        "plugin:@typescript-eslint/recommended",
        "plugin:prettier/recommended",
        "prettier/@typescript-eslint"
      ],
      "parser": "@typescript-eslint/parser",
      "plugins": ["react-hooks", "@typescript-eslint"],
      "env": {
        "browser": true,
        "node": true
      },
      "settings": {
        "react": {
          "pragma": "React",
          "version": "detect"
        }
      },
      "parserOptions": {
        "ecmaVersion": 2019,
        "sourceType": "module",
        "ecmaFeatures": {
          "jsx": true
        }
      },
      "rules": {
        "prettier/prettier": "warn",
        "react-hooks/rules-of-hooks": "error",
        "react-hooks/exhaustive-deps": "warn",
        "@typescript-eslint/no-use-before-define": "off",
        "@typescript-eslint/explicit-function-return-type": "off",
        "@typescript-eslint/camelcase": "off",
        "@typescript-eslint/explicit-member-accessibility": "off",
        "@typescript-eslint/ban-ts-ignore": "off",
        "@typescript-eslint/no-non-null-assertion": "off",
        "@typescript-eslint/no-explicit-any": "off",
        "@typescript-eslint/no-empty-interface": "off",
        "react/prop-types": "off",
        "react/display-name": "off"
      }
    }
    

     

    加載中
    返回頂部
    頂部
    聚看影院