javascript - 我从 nodejs index.js 得到的 Javascript 不常见错误
问题描述
我不明白如何从运行 javascript index.js 文件中得到这个错误,我的项目是一个 firebase 函数,这是来自 nodejs index.js 脚本的错误,我使用 Visual Studio 作为 IDE。
3:1 error Expected space or tab after '//' in comment spaced-comment
4:1 error Expected space or tab after '//' in comment spaced-comment
13:1 error This line has a length of 126. Maximum allowed is 80 max-len
13:89 error Missing semicolon semi
17:16 error Strings must use doublequote quotes
17:68 error Missing trailing comma comma-dangle
21:1 error Missing JSDoc comment require-jsdoc
21:18 error Missing space before opening brace space-before-blocks
22:1 error Expected indentation of 2 spaces but found 4 indent
26:1 error Expected indentation of 2 spaces but found 4 indent
26:5 error Unexpected var, use let or const instead no-var
26:17 error Multiple spaces found before 'req' no-multi-spaces
27:1 error Expected indentation of 2 spaces but found 4 indent
27:5 error Unexpected var, use let or const instead no-var
28:1 error Expected indentation of 2 spaces but found 4 indent
28:5 error Expected space(s) after "if" keyword-spacing
28:14 error Missing space before opening brace space-before-blocks
29:1 error Expected indentation of 4 spaces but found 8 indent
29:28 error Trailing spaces not allowed no-trailing-spaces
30:1 error Expected indentation of 2 spaces but found 4 indent
31:4 error Newline required at end of file but not found eol-last
✖ 21 problems (21 errors, 0 warnings)
19 errors and 0 warnings potentially fixable with the `--fix` option.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ lint: `eslint .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\chris\AppData\Roaming\npm-cache\_logs\2021-06-07T04_32_11_868Z-debug.log
events.js:288
throw er; // Unhandled 'error' event
解决方案
在项目的functions文件夹内"lint": "eslint ."
的
"lint": "eslint"
文件中更改
package.json
推荐阅读
- python - 使用 Python、ExcelWriter 和 openpyxl 创建一个空白工作表并向该新工作表添加文本
- android - 在循环内对 Recycleview 适配器进行排序
- twitter-bootstrap - Bootstrap 4.3.1 使用 Gulp 和 .sass 文件(不是 .scss)更改断点
- c# - 通用且快速地对属性执行计算
- ieee-754 - IEEE-754 中的“交换格式”是什么意思?
- java - 当我在java中启动一个线程时,方法run()没有运行
- vb.net - 将通过 VB.net 创建的自动递增 ID 从父表填充到 SQLite 中的多个子表
- javascript - 删除过去的日期 - Jquery Datepicker
- powershell - SMART Hard Drive INFO Powershell
- excel - 循环并仅用一个替换两个或多个空格