我正在做一个有eslintrc文件的项目,当我在我的Intellij项目中运行npm run test时。我得到一个错误
Expected indentation of 1 tab character but found 0
我尝试选中为.eslintrc文件启用ESlint搜索>其他设置>默认设置>语言和框架> javascript >代码质量工具> ESLint的复选框
{
"parser": "babel-eslint",
"extends": [
"airbnb",
我正在准备我的第一次试镜。由于某些原因,它在其他计算机上工作,但我的除外。
Im使用VScode
一旦打开编辑器,就会收到以下消息:无法读取配置文件:/Users/user/Documents/repos/project/C:/mydirectory/.eslintrc.json Error: ENOENT: no such file or directory, open Source: ESLint (Extension)
.eslintrc.json在我的根目录上。
这是我的配置文件:
{
"parser": "babel-eslint",
有人告诉我
ESLint couldn't find the plugin "@typescript-eslint/eslint-plugin".
(The package "@typescript-eslint/eslint-plugin" was not found when loaded as a Node module from the directory "D:\XXX\NNN".)
It's likely that the plugin isn't installed correctly. Try rein
我正在使用create app+ typescript + eslint应用程序,在构建过程中有这样的错误:
Line 1:8: 'React' was used before it was defined @typescript-eslint/no-use-before-define
组件中的代码以以下代码开头:
import React from "react";
Eslint设置:
module.exports = {
parser: "@typescript-eslint/parser",
parserOptions: {
我刚开始使用Next.js on WebStorm 2022.2.1构建#WS-222.3739.57。我创建了一个启用了Next.js的新TypeScript项目,仅此而已。
错误如下所示:
TypeError: this.libOptions.parse is not a function
TypeError: this.libOptions.parse is not a function
at ESLint8Plugin.<anonymous> (C:\Program Files\JetBrains\WebStorm 2022.1.2\plugins\JavaScr
我正在使用一个Angular项目,只是想再一次使用带有Prettier的ESLint。遗憾的是,有一个恼人的问题,即每次导入时都会显示警告'XYZ' is defined but never used. eslint(@typescript-eslint/no-unused-vars) ? ? 我只能在完全禁用此规则的情况下修复此问题。但是,我不会像第22行那样得到关于未使用的常量变量的提示。 我的eslintrc.json: {
"parser": "@typescript-eslint/parser", // Speci
在将eslint升级到8之后,我在每个测试模块上得到了以下错误:
error Definition for rule 'jest/valid-describe' was not found jest/valid-describe
eslintrc.json的一部分:
{
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
在monorepo设置中,有些ESLint插件没有安装,而plugins数组中没有列出这些插件,这会导致错误。
我的项目在packages/**下有几个包
yarn lint
yarn run v1.15.2
$ eslint --config .eslintrc ./
Oops! Something went wrong! :(
ESLint: 5.16.0.
ESLint couldn't find the plugin "eslint-plugin-airbnb". This can happen for a couple different reasons:
我在为我的Angular项目从TSLint迁移到ESLint的过程中遇到了一些严重的问题。我的工作方式是创建一个全新的项目(目前是Angular 9),然后升级到Angular 10.2。我遵循了中的指导原则,并运行了npx tslint-to-eslint-config。然而,当我试图通过我的Visual Studio Code扩展运行ESLint时,当它试图ESLint我的app.component.ts文件时,我得到了以下错误:
Error while loading rule '@angular-eslint/template/banana-in-box': You h
我试图运行Eslint作为一个Github动作,但我不知道为什么下面的测试通过,即使有一个明显的错误。
这是我的工作流定义
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# ESLint is a tool for identifying and