当前位置:网站首页>ESLint常见问题解决方案集锦
ESLint常见问题解决方案集锦
2022-07-28 05:30:00 【HousLin】
const saveCode = "代码保存时编辑器"
1、saveCode 单引号自动变双引号,如何更改过来
2、saveCode 自动在末尾加分号
3、saveCode 自动在末尾加逗号
- 由于这三个都是在.prettierrc文件中配置,所以统一写在一起
- 解决方案:
先看跟main同级有没有.prettierrc文件,如果有就在里面添加以下代码;
如果没有则新增一个.prettierrc文件,具体代码如下:
{
"semi": false, // 关闭保存自动加分号
"singleQuote": true, // true为双引变单引,false为单引变双引
"trailingComma": "none", // 隐藏保存后末尾自动加逗号
}
4、函数名后面需要多加一个空格,但一保存空格却被格式化掉
解决方案: 在.eslintrc.js中的rules下新增以下代码,去掉新增空格
'space-before-function-paren': 0
5、三个等于号换成两个就一直报警告eqeqeq
解决方案: 在.eslintrc.js中的rules下新增以下代码,去掉新增空格
'eqeqeq': ['off']
6、所有rulus关闭警告代码
rules: {
// allow async-await
'generator-star-spacing': 'off',
// allow debugger during development
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-trailing-spaces': 'off',
'indent': 'off',
'spaced-comment': 'off',
'no-trailing-spaces': 'off',
'no-new': 'off',
'key-spacing': 'off',
'comma-dangle': 'off',
'eol-last': 'off',
'quotes': 'off',
'semi': 'off',
'keyword-spacing': 'off',
'space-before-blocks': 'off',
'comma-spacing': 'off',
'space-before-function-paren': 'off',
'space-infix-ops': 'off',
'no-multiple-empty-lines': 'off',
'block-spacing': 'off',
'padded-blocks': 'off',
'arrow-spacing': 'off',
'no-sequences': 'off',
'no-unused-expressions': 'off',
'no-multi-spaces': 'off',
'no-unused-vars': 'off',
'camelcase ': 'off',
'eqeqeq': ["off"],
'camelcase': 'off',
"prefer-const": "off"
},
,
"globals": {
"error": true
}
7、修改后保存重新启动项目,问题完美解决!
边栏推荐
- Three cache technologies -- localstorage, sessionstorage, cookies
- 最短寻道时间优先(SSTF)
- Log in to Oracle10g OEM and want to manage the monitor program, but the account password input page always pops up
- Pytorch - storage and loading model
- easypoi导出表格带echars图表
- Shell--- function
- Freemaker merges cells, uses if and else tags, and processes null and empty strings
- 读取xml文件里switch节点的IP和设备信息,ping设备,异常显示在列表里
- C language push box
- Uniapp monitor whether the app has a network connection
猜你喜欢

Codesensor: convert the code into AST and then into text vector

OJ questions about fast and slow pointers in linked lists

Branch and loop statements

MOOC Weng Kai C language fourth week: further judgment and circulation: 3. Multiple branches 4. Examples of circulation 5. Common errors in judgment and circulation

VNC Timed out waiting for a response from the computer

Nrf51822 review summary

A timed task reminder tool

win下安装nessus

NAT network address translation

Generate create table creation SQL statement according to excel
随机推荐
三层交换和VRRP
MOOC Weng Kai C language week 3: judgment and cycle: 1. Judgment
Deployment of elk log analysis system
Pictures are adaptive to the screen
Standard C language learning summary 6
远程访问云服务器上Neo4j等服务的本地网址
TOPK problem
Operation document tree
Differences and relationships among NPM, Yran and NPX
DOM window related data, operations & BOM operations
Uniapp monitor whether the app has a network connection
A timed task reminder tool
Gd32f407 porting freertos+lwip
Shell --- conditional statement practice
easypoi导出隔行样式设置
主动扫描技术nmap详解
Group management and permission management
Install Nessus under win
Shell--- sed statement exercise
Standard C language summary 2