1 Star 0 Fork 0

Bonjour-lily/react-quickly-start

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.eslintrc.js 3.23 KB
一键复制 编辑 原始数据 按行查看 历史
Bonjour-lily 提交于 2021-10-21 15:55 . chore: fix bugs 构建配置
const OFF = 0
const WARN = 1
const ERROR = 2
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'airbnb',
'airbnb/hooks',
'plugin:react/recommended',
'plugin:unicorn/recommended',
'plugin:promise/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: 'module',
},
plugins: ['react', 'unicorn', 'promise', '@typescript-eslint', 'prettier'],
settings: {
'import/resolver': {
node: {
extensions: ['.tsx', '.ts', '.js', '.json'],
},
typescript: {},
},
},
rules: {
'import/extensions': [
ERROR,
'ignorePackages',
{
ts: 'never',
tsx: 'never',
json: 'never',
js: 'never',
},
],
'import/no-extraneous-dependencies': [ERROR, { devDependencies: true }],
'import/prefer-default-export': OFF,
'import/no-unresolved': ERROR,
'import/no-dynamic-require': OFF,
'unicorn/better-regex': ERROR,
'unicorn/prevent-abbreviations': OFF,
'unicorn/filename-case': [
ERROR,
{
cases: {
// 中划线
kebabCase: true,
// 小驼峰
camelCase: true,
// 下划线
snakeCase: false,
// 大驼峰
pascalCase: true,
},
},
],
'unicorn/no-array-instanceof': WARN,
'unicorn/no-for-loop': WARN,
'unicorn/prefer-module': OFF,
'unicorn/prefer-add-event-listener': [
ERROR,
{
excludedPackages: ['koa', 'sax'],
},
],
'unicorn/prefer-query-selector': ERROR,
'unicorn/no-null': OFF,
'unicorn/no-array-reduce': OFF,
'@typescript-eslint/no-useless-constructor': ERROR,
'@typescript-eslint/no-empty-function': WARN,
'@typescript-eslint/no-var-requires': OFF,
'@typescript-eslint/explicit-function-return-type': OFF,
'@typescript-eslint/explicit-module-boundary-types': OFF,
'@typescript-eslint/no-explicit-any': OFF,
'@typescript-eslint/no-use-before-define': ERROR,
'@typescript-eslint/no-unused-vars': WARN,
'no-unused-vars': OFF,
'react/jsx-filename-extension': [ERROR, { extensions: ['.tsx', 'ts', '.jsx', 'js'] }],
'react/jsx-indent-props': [ERROR, 2],
'react/jsx-indent': [ERROR, 2],
'react/jsx-one-expression-per-line': OFF,
'react/destructuring-assignment': OFF,
'react/state-in-constructor': OFF,
'react/jsx-props-no-spreading': OFF,
'react/prop-types': OFF,
'jsx-a11y/click-events-have-key-events': OFF,
'jsx-a11y/no-noninteractive-element-interactions': OFF,
'jsx-a11y/no-static-element-interactions': OFF,
'lines-between-class-members': [ERROR, 'always'],
// indent: [ERROR, 2, { SwitchCase: 1 }],
'linebreak-style': [ERROR, 'unix'],
quotes: [ERROR, 'single'],
semi: [ERROR, 'never'],
'no-unused-expressions': WARN,
'no-plusplus': OFF,
'no-console': OFF,
'class-methods-use-this': ERROR,
'jsx-quotes': [ERROR, 'prefer-double'],
'global-require': OFF,
'no-use-before-define': OFF,
'no-restricted-syntax': OFF,
'no-continue': OFF,
},
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/Bonjour-lily/react-quickly-start.git
git@gitee.com:Bonjour-lily/react-quickly-start.git
Bonjour-lily
react-quickly-start
react-quickly-start
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385