Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable warning message for eslint rule not being found

I'm working on getting eslint working in my app for the first time. I have it mostly working, but since I've started disabling some of the rules I imported my browser console and command line have started being cluttered up with the same warning.

When I run nodemon, my command line is filled with the same warning. enter image description here

I also get a similar message in the browser console enter image description here

My app is functioning as intended and linting is working as well. I was just wondering if there was a way to get rid of these warning messages

Here are some possibly relevant files:

package.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

Thank you

like image 285
Jon_B Avatar asked Oct 17 '22 04:10

Jon_B


2 Answers

Change "jsx-a11y/anchor-is-valid": "off" to "jsx-a11y/anchor-is-valid": 2 and remove "jsx-a11y/href-no-hash": "off", according to https://github.com/airbnb/javascript/issues/1474

like image 158
Dane Avatar answered Oct 27 '22 08:10

Dane


Problem solved by switching eslint-plugin-jsx-a11y to version 5.1.1

like image 22
Jon_B Avatar answered Oct 27 '22 08:10

Jon_B