How to disable ESLint react/prop-types rule in a file?

后端 未结 5 823
无人及你
无人及你 2020-12-13 11:37

I\'m using React and ESLint with eslint-plugin-react.

I want to disable the prop-types rule in one f

5条回答
  •  时光取名叫无心
    2020-12-13 12:35

    I had to do:

    /* eslint react/forbid-prop-types: 0 */
    

    this did not work for me:

    /* eslint react/prop-types: 0 */
    

    To disable globally in your .eslintrc file (old version v6.0 or below):

    {
        "rules": {
            "react/forbid-prop-types": 0
        }
    }
    

    To disable globally in your .eslintrc file (new version above v6.0):

    {
        "rules": {
            "react/prop-types": 0
        }
    }
    

提交回复
热议问题