当前位置:网站首页>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、修改后保存重新启动项目,问题完美解决!
边栏推荐
- Differences and relationships among NPM, Yran and NPX
- Neo4j运行报错Error occurred during initialization of VM Incompatible minimum and maximum heap sizes spec
- rsync+inotify实现远程实时同步
- 232 (female) to 422 (male)
- C language address book system
- Raspberry pie serial port
- 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
- MOOC Weng Kai C language week 3: judgment and circulation: 2. circulation
- Install Nessus under win
- DOM operation cases
猜你喜欢

GFS分布式文件系统

C language: understand the creation and destruction of function stack frames through an example

easypoi导出隔行样式设置

Shell--第一天作业

Easypoi one to many, merge cells, and adapt the row height according to the content

Leetcode then a deep copy of the linked list

MOOC Weng Kai C language fourth week: further judgment and circulation: 1. Logical types and operations 2. Judgment of cascading and nesting

Pytorch - storage and loading model

Generate create table creation SQL statement according to excel

DHCP service
随机推荐
Wangeditor (@4.7.15) - lightweight rich text editor
OJ questions about fast and slow pointers in linked lists
joern运行后.joernindex数据库无内容
Freemaker exports word with tables and multiple pictures to solve the repetition and deformation of pictures
DOM -- event chain, event bubble and capture, event proxy
Event_ Loop event loop mechanism
vcf文件制作
PXE unattended installation management
easypoi一对多,合并单元格,并且根据内容自适应行高
Standard C language summary 4
TOPK problem
Freemaker merges cells, uses if and else tags, and processes null and empty strings
多进程(多核运算)Multiprocessing
Review of C language (byte alignment)
Standard C language summary 2
Tutorial on regularization
Layer 3 switching and VRRP
Small turtle C (Chapter 6 arrays 1 and 2)
DOM -- page rendering, style attribute operation, preloading and lazy loading, anti shake and throttling
Three cache technologies -- localstorage, sessionstorage, cookies