DEV Community

Alex Sharp 🛠sharesecret.co
Alex Sharp 🛠sharesecret.co

Posted on • Updated on • Originally published at ajsharp.com

Disabling specific eslint rules

The create react app eslint presets come with a few rules that are slightly annoying. One of them is jsx-a11y/href-no-hash, which makes sure you don’t add an tag without a valid http address for the href property.
To ignore this, add a .eslintrc.js file at the project root with the following:

module.exports = {
  "parser": "babel-eslint",
  "env": {
    "browser": true
  },
  "rules": {
    "jsx-a11y/anchor-is-valid": "off"
  }
}

Then make sure to reload the vscode window.

Full eslint config file documentation here.


☝️ Be sure to check out Sharesecret, which makes it easy to securely share sensitive data.

Discussion (0)