js应用程序。对于此应用程序,我需要使用eslint。我在VS代码编辑器中使用和更漂亮的插件。
.eslintrc
{
"extends": "airbnb"
}
我看到在添加了eslint插件、和npm包之后,VS代码在完整的项目中给了我很多错误。
几个错误
[eslint] Definition for rule 'jsx-a11y/href-no-hash' was not found (jsx-a11y/href-no-hash)
[eslint] Expected linebreaks to be 'LF' but
我刚刚切换到VS代码并安装了ESLint扩展,我得到了以下错误:
[Info - 15:29:51] ESLint server is running.
[Info - 15:29:53] ESLint library loaded from: /usr/local/lib/node_modules/eslint/lib/api.js
[Error - 15:29:53] Cannot read config file: /Users/carlosgrijalva/.eslintrc Error: unexpected end of the stream within a flow col
我正在做一个有eslintrc文件的项目,当我在我的Intellij项目中运行npm run test时。我得到一个错误
Expected indentation of 1 tab character but found 0
我尝试选中为.eslintrc文件启用ESlint搜索>其他设置>默认设置>语言和框架> javascript >代码质量工具> ESLint的复选框
{
"parser": "babel-eslint",
"extends": [
"airbnb",
我刚建立了一个带有类型记录的创建-反应-应用项目。我在npx eslint --init中添加了eslint。当我运行npx eslint src/或npx eslint src时,会得到一个错误:
Oops! Something went wrong! :(
ESLint: 8.18.0
No files matching the pattern "src" were found.
Please check for typing mistakes in the pattern.
但是,如果我使用以下命令:npx eslint src/*,那么它就能工作。这很好,但我看到的
我的缩进设置是4个空格,但正如你在我的屏幕截图中看到的,这段代码被自动修复为2个空格,然后eslint抛出了错误。
以下是错误背后的代码
import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'
import actions from './actions'
Vue.use(Vuex)
export default new Vuex.Stor
我不知道如何为函数括号之间的空格设置配置。我已经将它设置为everywhere为true,但是当我保存一个.vue文件时,空格就被删除了--删除后,它被高亮显示为错误(Missing space between function parentheses)。它发生在script部分。在.js文件空间中添加了,但也突出显示为错误,这一次.Unexpected space between function parentheses?!有一些设置的配置(我现在无法重新创建)时,在保存空间时添加了片刻,然后在.vue文件中再次删除。
我的settings.json
"vetur.format.de
我是Vue生态系统的新手,我正试图在一个测试项目中获得干净的eslint-plugin-vue结果。在下面的测试Home.vue文件中,我得到了一个警告:The "HelloWorld" component has been used but not registered (vue/no-unregistered-components)。有什么语法上正确的方法来清理这件事?
这是否是 ESLint规则本身的一个限制,即它不承认export default class Home extends Vue {}和@Component(...)语法?
<template>
在为CRA应用程序运行测试时,所有组件都会出现以下错误:
ERROR: 'import' and 'export' may appear only with 'sourceType: "module"'
我使用的是创建-反应-应用,与反应16.7.0-字母2和反应-多姆16.7.0-字母2。
react应用程序嵌套在根目录中的一个目录中。
我正在运行运行npm脚本:"test": "jest --config jest.local.config.json --coverage"的根目录中的jest
我面临着使用Vue呈现字符串的问题。当前,如果HTML标记在不同的行上被打开和关闭。
<span class="description">
{{ text }}
</span>
它的呈现方式如下
<span class="description">
text
</span>
这将导致document.querySelector('.description').textContent返回包含冗余空格的字符串。例如。
"
T
我在VS代码中使用Nuxt 2.15.7,使用Node版本14.17.1和eslint扩展。
问题
我开始在每个文件的第一个字符下面看到一条红色的线条。在它上方盘旋时,我看到的是这样的错误:
require() of ES modules is not supported.
require() of C:\Users\SR Gears\Documents\work\my-website\node_modules\eslint\node_modules\eslint-scope\lib\definition.js
from C:\Users\SR Gears\Documents\work\my