ESLint:找不到模块'lib / rules / max-classes-per-file.js'

时间:2018-07-17 21:41:09

标签: javascript node-modules eslint

我需要你的帮助。我已安装 eslint npm软件包(4.19.1),以使用Airbnb样式指南并进行良好实践。

因此,我已经为规则配置了选项,然后在编写代码时,消息显示以下内容:

ESLint: Cannot find module '/X/Y/Desktop/project/node_modules/eslint/lib/rules/max-classes-per-file.js'. Please see the 'ESLint' output channel for details.

我正在查看node_modules,而这不在这里。

如何解决该问题? 预先感谢。

问候, 弗兰。

1 个答案:

答案 0 :(得分:1)

https://eslint.org/docs/rules/max-classes-per-file#version

中所述
  

此规则在ESLint 5.0.0-alpha.3。中引入。

Values of y [0. 0. 0. 0. 1. 0. 0. 0. 0. 0.] Values of y [1. 0. 0. 0. 0. 0. 0. 0. 0. 0.] Values of y [0. 0. 0. 0. 0. 1. 0. 0. 0. 0.] Values of y [0. 0. 0. 1. 0. 0. 0. 0. 0. 0.] Values of y [0. 0. 1. 0. 0. 0. 0. 0. 0. 0.] Values of y [0. 0. 0. 0. 0. 0. 0. 0. 0. 1.] Values of y [0. 0. 0. 1. 0. 0. 0. 0. 0. 0.] Values of y [0. 0. 0. 0. 1. 0. 0. 0. 0. 0.] Values of y [0. 0. 0. 0. 0. 0. 0. 0. 1. 0.] Values of y [0. 0. 0. 0. 0. 0. 0. 0. 0. 1.] 删除max-classes-per-file规则,或使用ESLint v.5.x.x

如果您已在全球范围内安装了eslint,只需致电以下即可下载最新软件包(现在是v.5.1.0):

.eslintrc