700得票41回答
为什么我总是收到 "[eslint] 删除 `CR` [prettier/prettier]" 的提示?

我正在使用带有Prettier 1.7.2和ESLint 1.7.0的VS Code。 每次换行后我都会遇到以下问题:[eslint] Delete `CR` [prettier/prettier] 这是.eslintrc.json文件:{ "extends": [&q...

246得票7回答
ESLint:TypeError:this.libOptions.parse不是一个函数

我正在使用 WebStorm 2022.2.1 Build #WS-222.3739.57 开始学习 Next.js。 我创建了一个启用 TypeScript 的新 Next.js 项目,这就是全部。 错误如下所示:TypeError: this.libOptions.parse is not...

229得票2回答
如何禁用eslint的多个规则nextline

我有这段代码: const subTotal = orderInfo.details.reduce((acc, cv) => acc += Number(cv.price) * Number(cv.quantity), 0); 我想在这一行禁用两个ESLint检查类型,即no-re...

104得票4回答
安装jest时出现“describe未定义”的错误

我在项目中安装了jest v24.7.1: npm install jest -D 然后我开始编写一些测试文件,但是我遇到了以下eslint错误: 'describe' is not defined. eslint (no-undef) 'it' is not defined. e...

85得票4回答
是否可以在所有的eslint规则中显示警告而不是错误?

正如标题所说,是否有可能让eslint在所有规则上显示警告而不是错误?如果这个信息有关联的话,我正在使用Standard JS。 谢谢!

84得票2回答
在我的React应用程序中使用Jest时,出现“describe is not defined”错误。

我刚接触 Jest,正在尝试弄清楚以下代码中的一些基础知识。import * as actions from './IncrementalSearchActions'; describe('Incremental Search Actions', () => { it('Sho...

71得票2回答
我该如何在 ESLint 中禁用 prettier/prettier 错误提示?

在编码过程中,我没有使用eslint。现在我安装了它,但它使我的编辑器充斥着prettier/prettier错误,这些错误似乎并不能让我的代码更漂亮。我正在寻找解决方法。 prettierrc.js:module.exports = { bracketSpacing: true, ...

61得票5回答
ESLint规则"import/extensions"的定义未找到。

我在使用VS Code中的ESLint检查TypeScript文件时遇到以下两个错误: Definition for rule 'import/extensions' was not found.eslint(import/extensions) Definition for rule 'i...

58得票4回答
ESLint:解析错误:此实验性语法需要启用以下解析器插件之一:'jsx,flow,typescript'(2:9)

我正在尝试在WebStrom中使用ESLint,但它无法正常工作并显示错误信息: ``` ESLint: 解析错误:此实验性语法需要启用以下解析器插件之一:“jsx,flow,typescript”(2:9)。 ``` 这是我的 `.eslintrc` 和 `package.json` 设...

52得票6回答
忽略或防止 ESLint 错误在 React 项目(create-react-project)中破坏构建

最近我用 create-react-project 创建了一个项目。 问题是,在开发过程中,每当 ESLint 出现问题时,构建就会失败并且无法编译代码。 我能否在保持构建运行的同时仍然运行ESLint,并报告稍后修复的错误?