2 Star 2 Fork 1

Hongshaoli/react-next-app

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.eslintrc.js 2.42 KB
一键复制 编辑 原始数据 按行查看 历史
hsl947 提交于 2020-08-11 16:42 +08:00 . 集成antd,优化代码结构
module.exports = {
extends: [
'eslint:all',
'airbnb',
'airbnb-typescript',
"plugin:react-hooks/recommended",
'plugin:prettier/recommended' // prettier配置
],
parserOptions: {
project: './tsconfig.json'
},
rules: {
"semi": ['error', 'never'],
"@typescript-eslint/semi": ['error', 'never'],
'import/no-extraneous-dependencies': 0,
'import/extensions': 'off',
'import/no-unresolved': 0,
'default-param-last': 0,
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx', 'tsx'] }], // 关闭airbnb对于jsx必须写在jsx文件中的设置
'react/prop-types': 'off', // 关闭airbnb对于必须添加prop-types的校验
'react/destructuring-assignment': [
1,
'always',
{
ignoreClassFields: false
}
],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
'react/jsx-one-expression-per-line': 'off', // 关闭要求一个表达式必须换行的要求,和Prettier冲突了
'react/jsx-wrap-multilines': 0, // 关闭要求jsx属性中写jsx必须要加括号,和Prettier冲突了
'comma-dangle': ['error', 'never'],
'react/jsx-first-prop-new-line': [1, 'multiline-multiprop'],
'react/prefer-stateless-function': [0, { ignorePureComponents: true }],
'jsx-a11y/no-static-element-interactions': 'off', // 关闭非交互元素加事件必须加 role
'jsx-a11y/click-events-have-key-events': 'off', // 关闭click事件要求有对应键盘事件
'jsx-a11y/anchor-is-valid': 'off', // 关闭click事件要求有对应键盘事件
'jsx-a11y/label-has-associated-control': 'off', // 关闭click事件要求有对应键盘事件
'jsx-a11y/no-noninteractive-element-interactions': 'off', // 关闭click事件要求有对应键盘事件
'no-bitwise': 'off', // 不让用位操作符,不知道为啥,先关掉
'react/jsx-indent': [2, 2],
'react/jsx-no-undef': [2, { allowGlobals: true }],
'jsx-control-statements/jsx-use-if-tag': 0,
'react/no-array-index-key': 0,
'react/jsx-props-no-spreading': 0,
// 禁止使用 var
'no-var': 'error',
quotes: [2, 'single'],
// @fixable 必须使用 === 或 !==,禁止使用 == 或 !=,与 null 比较时除外
eqeqeq: [
'warn',
'always',
{
null: 'ignore'
}
],
'no-use-before-define': ['error', { functions: false }],
'prettier/prettier': ['error', { parser: 'flow' }]
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/hsl947/react-next-app.git
git@gitee.com:hsl947/react-next-app.git
hsl947
react-next-app
react-next-app
master

搜索帮助