Disabling specific eslint rules
Alex Sharp 🛠sharesecret.co
Posted on March 4, 2019
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.
💖 💪 🙅 🚩
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
todayilearned How to add Dribble social login to your React Application using Auth0.
September 26, 2021