前端问答 关闭Expected ‘this’ to be used by class method这个规则 2020-12-15 15:34:42 Avecle丶soleil 取消关注 关注 私信 ESLint会提示这个,其实就是如果在示例方法中没有使用this,那么ESLint推荐你写成static方法,可以关闭这个。 在.eslintrc.js中把class-methods-use-this这个规则关闭: { 'rules': { "class-methods-use-this": "off", } } 赞赏 人已赞赏