Disabling specific eslint rules

ajsharp

Alex Sharp 🛠sharesecret.co

Posted on March 4, 2019

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.

💖 💪 🙅 🚩
ajsharp
Alex Sharp 🛠sharesecret.co

Posted on March 4, 2019

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related