Eslint-plugin-jsx-a11y: Error: Configuration for rule "jsx-a11y/anchor-has-content" is invalid

Created on 10 Nov 2016  路  1Comment  路  Source: jsx-eslint/eslint-plugin-jsx-a11y

I get the following error:

.../node_modules/eslint-config-airbnb/rules/react-a11y.js:
    Configuration for rule "jsx-a11y/anchor-has-content" is invalid:
    Value "" is the wrong type.

Referenced from: airbnb
Referenced from: .../.eslintrc
Error: .../node_modules/eslint-config-airbnb/rules/react-a11y.js:
    Configuration for rule "jsx-a11y/anchor-has-content" is invalid:
    Value "" is the wrong type.

Referenced from: airbnb
Referenced from: .../.eslintrc
    at validateRuleOptions (.../node_modules/eslint/lib/config/config-validator.js:115:15)
    at .../node_modules/eslint/lib/config/config-validator.js:162:13
    at Array.forEach (native)
    at Object.validate (.../node_modules/eslint/lib/config/config-validator.js:161:35)
    at load (.../node_modules/eslint/lib/config/config-file.js:522:19)
    at .../node_modules/eslint/lib/config/config-file.js:391:36
    at Array.reduceRight (native)
    at applyExtends (.../node_modules/eslint/lib/config/config-file.js:362:28)
    at load (.../node_modules/eslint/lib/config/config-file.js:529:22)
    at .../node_modules/eslint/lib/config/config-file.js:391:36

for the following content of package.json:

    "eslint": "^3.9.1",
    "eslint-config-airbnb": "^13.0.0",
    "eslint-plugin-import": "^2.2.0",
    "eslint-plugin-jsx-a11y": "^3.0.1",
    "eslint-plugin-react": "^6.6.0",
    "eslint-plugin-sorting": "^0.3.0",

However for version 2.2.3 of eslint-plugin-jsx-a11y it works.

Node version: 6.4.0
NPM version: 3.10.3

My .eslintrc:

{
  "env": {
    "mocha": true,
    "node": true
  },
  "extends": "airbnb",
  "plugins": [
    "sorting"
  ],
  "rules": {
    "class-methods-use-this": "off",
    "import/extensions": "off",
    "import/imports-first": "off",
    "import/no-extraneous-dependencies": "off",
    "max-len": [
      "error",
      120
    ],
    "new-cap": "off",
    "newline-before-return": "error",
    "one-var": [
      "error",
      {
        "initialized": "never"
      }
    ],
    "one-var-declaration-per-line": [
      "error",
      "initializations"
    ],
    "sort-imports": "error",
    "sort-keys": "error",
    "sort-vars": "error"
  }
}

Most helpful comment

@oprogramador this is because the airbnb config explicitly requires 2.x of eslint-plugin-jsx-a11y.

If you install eslint-config-airbnb with the shell command in the readme, you'll get the proper peer dep versions.

>All comments

@oprogramador this is because the airbnb config explicitly requires 2.x of eslint-plugin-jsx-a11y.

If you install eslint-config-airbnb with the shell command in the readme, you'll get the proper peer dep versions.

Was this page helpful?
0 / 5 - 0 ratings