首页 技术 正文
技术 2022年11月15日
0 收藏 781 点赞 4,207 浏览 1137 个字

google: eslint+rules

es6: impot

When you import the module's default, don't use brace {}

意思是,当你使用默认的模块时,不要加{}。如果不是默认模块的话,请把{}加上。

定义后不使用

对象的最后一个属性后面要加逗号

不得重复定义

缩进

constructor必须有super

constructor必须有意义,就是有其他代码

if 后要有括号

no-trailing-spaces

最后面不能有额外的空格

关闭的标签必须对齐

The closing bracket must be aligned with the line containing the opening tag.// like this
<Icon
/>

不得在refs里使用字符串

using string literals in ref attribute is deprecated.// so should use like this:
<input
type="text"
ref={(c) => {
this.input = c;
}}
/>handleClick(e) {
const node = this.input;
const value = node.value;
}unexpected parentheses around single function argument having a body with no

单个函数参数周围的意外括号具有一个没有花括号的主体的箭头

unexpected parentheses around single function argument having a body with no curly braces arrow-parens

箭头函数不应该返回赋值

arrow function should not return assignment.

箭头函数参数周围的预期括号具有带大括号的主体

expected parenteses around arrow function argument having a body with curly braces arrow-parens

jsx中等号前面没有空格

there should ne no space before '='

没有交互的元素不允许有事件

visible, non-interactive elements should not have moue or keyboard listeners jsx-ally/no-static-element-interationscommon interactive roles include:1. button
2. link
3. checkbox
4. menuitem
5. menuitemcheckbox
6. menuitemradio
7. option
8. radio
9. searchbox
10. switch
11. textbox
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,488
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,903
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,736
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,487
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,127
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,289