簡體   English   中英

禁用未找到 eslint 規則的警告消息

[英]Disable warning message for eslint rule not being found

我正在努力讓 eslint 第一次在我的應用程序中工作。 我大部分時間都在工作,但自從我開始禁用一些規則后,我導入的瀏覽器控制台和命令行開始被相同的警告弄得亂七八糟。

當我運行 nodemon 時,我的命令行充滿了相同的警告。 在此處輸入圖片說明

我也在瀏覽器控制台中收到類似的消息在此處輸入圖片說明

我的應用程序按預期運行,linting 也正常運行。 我只是想知道是否有辦法擺脫這些警告消息

以下是一些可能相關的文件:

包.json

{
    "name": "server",
    "version": "1.0.0",
    "description": "",
    "main": "index.js",
    "engines": {
        "node": "8.4.0",
        "npm": "5.3.0"
    },
    "scripts": {
        "start": "node index.js",
        "server": "nodemon index.js",
        "client": "npm run start --prefix client",
        "dev": "concurrently \"npm run server\" \"npm run client\"",
        "lint": "eslint ."
    },
    "author": "",
    "license": "ISC",
    "dependencies": {
        "concurrently": "^3.5.0",
        "cookie-session": "^1.3.1",
        "express": "^4.15.4",
        "mongoose": "^4.11.10",
        "nodemon": "^1.12.0",
        "passport": "^0.4.0",
        "passport-google-oauth20": "^1.0.0"
    },
    "devDependencies": {
        "eslint": "^4.9.0",
        "eslint-config-airbnb": "^16.1.0",
        "eslint-plugin-import": "^2.7.0",
        "eslint-plugin-jsx-a11y": "^6.0.2",
        "eslint-plugin-react": "^7.4.0"
    }
}

.eslintrc

{
  "extends": [
    "airbnb"
  ],
  "root": true,
  "rules": {
    "import/prefer-default-export": "off",
    "arrow-parens": ["error", "as-needed"],
    "no-tabs": "off",
    "indent": "off",
    "function-paren-newline": "off",
    "max-len": "off",
    "no-console": "off",
    "react/jsx-filename-extension": "off",
    "react/prop-types": "off",
    "consistent-return": "off",
    "jsx-a11y/anchor-is-valid": "off",
    "jsx-a11y/href-no-hash": "off"
  }
}

.eslintignore

node_modules
.gitignore
*.md
*.json
config/keys.js
client/src/registerServiceWorker.js

謝謝

通過將 eslint-plugin-jsx-a11y 切換到 5.1.1 版本解決的問題

變化"jsx-a11y/anchor-is-valid": "off""jsx-a11y/anchor-is-valid": 2和刪除"jsx-a11y/href-no-hash": "off" ,根據https://github.com/airbnb/javascript/issues/1474

暫無
暫無

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

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