博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
React 添加eslint检测
阅读量:6191 次
发布时间:2019-06-21

本文共 1942 字,大约阅读时间需要 6 分钟。

1). 添加包
npm install eslint --save-devnpm install eslint-config-airbnb --save-devnpm install eslint-plugin-import --save-devnpm install eslint-plugin-jsx-a11y --save-devnpm install eslint-plugin-react --save-devnpm install babel-eslint --save-dev
2). 在工程根目录下创建.eslintrc文件
{  "parser": "babel-eslint",  "extends": "airbnb",  "rules": {    "generator-star-spacing": [0],    "consistent-return": [0],    "react/forbid-prop-types": [0],    "react/jsx-filename-extension": [1, { "extensions": [".js"] }],    "global-require": [0],    "import/prefer-default-export": [0],    "react/jsx-no-bind": [0],    "react/prop-types": [0],    "react/prefer-stateless-function": [0],    "no-else-return": [0],    "no-restricted-syntax": [0],    "import/no-extraneous-dependencies": [0],    "no-use-before-define": [0],    "jsx-a11y/no-static-element-interactions": [0],    "no-nested-ternary": [0],    "arrow-body-style": [0],    "import/extensions": [0],    "no-bitwise": [0],    "no-cond-assign": [0],    "linebreak-style": [0],    "import/no-unresolved": [0],    "require-yield": [1],    "prefer-template":[0],    "no-undef":[0],    "no-param-reassign":[0],    "no-useless-escape":[0],    "no-plusplus":[0],    "no-mixed-operators":[0],    "object-shorthand":[0],    "no-console": [0],    "no-loop-func":[0],    "class-methods-use-this":[0],    "radix":[0],    "no-trailing-spaces":[0],    "comma-dangle": [0],    "no-underscore-dangle": [0],    "react/require-default-props": [0],    "no-unused-expressions": [0],    "react/sort-comp":[0],    "max-lines": [2,500],    "max-len": [2,125],    "react/jsx-boolean-value": [0],    "react/react-in-jsx-scope": [0],    "operator-assignment": [0],    "no-fallthrough": [0],    "react/no-array-index-key": [0],    "eqeqeq": [0],    "react/no-multi-comp": [0],    "react/no-unused-prop-types": [0],    "prefer-const": [0]  },  "parserOptions": {    "ecmaFeatures": {      "experimentalObjectRestSpread": true    }  }}

转载地址:http://aerda.baihongyu.com/

你可能感兴趣的文章
linux libjpeg 安装
查看>>
脚印:一次重构讨论
查看>>
Python学习的第二周作业--购物车
查看>>
D.6661 - Equal Sum Sets
查看>>
确保每一步的业务代码都能够正确执行。
查看>>
etcd:从应用场景到实现原理的全方位解读
查看>>
python基础===map和zip的用法
查看>>
【UVA 11426】gcd之和 (改编)
查看>>
iOS调用系统相册、相机 显示中文标题
查看>>
SEU第一次训练练习题
查看>>
重新定义日志成员
查看>>
Ansible安装
查看>>
poj3270
查看>>
python的requests模块参数详解
查看>>
-sh: ./helloworld: not found
查看>>
eclipse - The superclass "javax.servlet.http.HttpServlet" was not found on the Java
查看>>
数学 FZU 2074 Number of methods
查看>>
.NET MVC与三层架构
查看>>
5.IntellijIDEA常用快捷键总结
查看>>
The type org.springframework.core.io.support.ResourcePatternResolver cannot be resolved. It is ind
查看>>