-
ESLint 是一个强大的静态代码分析工具,用于识别和报告 JavaScript 代码中的模式和错误。它可以帮助你保持代码风格一致,避免常见的陷阱,并提升代码的可维护性。本教程将引导你如何安装、配置和使用 ESLint。
-
TS2794: Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?
-
eslint 报错:error Unexpected dangling '_' in '_t' no-underscore-dangle,如何解决呢?本文提供 3 终解决方案。
-
先看一段 typescript 报错信息:Property 'xxx' does not exist on type 'Window & typeof globalThis'.上述代码中从 window 对象上获取 AWSC 方法,AWSC 不是 window 对象上的原生方法,在 ts 中直接调用 window 对象的非原生方法或属性会报错。
-
Expected 1 arguments, but got 0. Did you forget to include 'void' in your type argument to 'Promise'?
-
eslint报错Spread types may only be created from object types,如何解决呢?先来看一个 eslint 报错信息:
ERROR in src/views/components/table.vue:37:7
TS2698: Spread types may only be created from object types.
35 | pageSize: props.page.size,
36 | total: props.page.total_counts,
> 37 | ...context.attrs.pagination,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
38 | }))
-
error Identifier xxx is not in camel case
-
eslint 报错:error Missing semicolon semi.报错信息很明确,缺少分号。详情报错信息示例: ERROR Failed to compile with 1 error 09:49:40[eslint]
/Users/teng/code/src/services/member.ts
1:34 error Missing semicolon semi
-
eslint Unexpected trailing comma. (comma-dangle)报错解决方法
-
error Expected the Promise rejection reason to be an Error (prefer-promise-reject-errors),prefer-promise-reject-errors