Poh*_*How 11 reactjs eslint eslintrc
我试图禁止jsx-a11y/anchor-is-valid在eslintrc.json。根据docs,相关规则块如下所示:
{
"rules": {
"jsx-a11y/anchor-is-valid": [ "error", {
"components": [ "Link" ],
"specialLink": [ "hrefLeft", "hrefRight" ],
"aspects": [ "noHref", "invalidHref", "preferButton" ]
}]
}
}
Run Code Online (Sandbox Code Playgroud)
在我升级create-react-app到 2.0 版之前,这曾经有效,我的 eslint 规则只是"jsx-a11y/anchor-is-valid": 0.
我已经阅读了eslint 文档,其中说我们可以简单地更改error为off,尽管我尝试过无济于事。
禁用规则的正确方法是什么,我应该参考哪些文档?