Skip to content

Commit

Permalink
Merge pull request #7 from eyea/main
Browse files Browse the repository at this point in the history
feat(chore): 将eslint 8.53.0 起删除的style相关规则off
  • Loading branch information
eyea authored Nov 11, 2023
2 parents edbf159 + 9be12b9 commit e6b95df
Show file tree
Hide file tree
Showing 4 changed files with 493 additions and 301 deletions.
136 changes: 100 additions & 36 deletions lib/configs/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,105 @@ module.exports = {
},
ignorePatterns: ['*.min.*'],
rules: {
// JavaScript Basic rules, 35条 使用afu的rules,和eslint/recommended搭配
'no-multi-spaces': 2,
'no-unused-vars': 1, // 非TS项目,此项需设为1
'no-undef': 0,
'no-empty-function': 2,
'no-shadow': 2,
'curly': 2,
'array-callback-return': 2,
'block-scoped-var': 2,
'default-case': 2,
'complexity': ['error', { 'max': 20 }],
'no-console': 0,
'no-await-in-loop': 2,
'no-mixed-spaces-and-tabs': 0,
'no-prototype-builtins': 0,
'no-useless-escape': 0,
'no-self-assign': 0,
'no-caller': 2,
'no-div-regex': 2,
'no-floating-decimal': 2,
'no-new-wrappers': 2,
'no-return-assign': 2,
'no-unmodified-loop-condition': 2,
'require-await': 2,
'wrap-iife': 1,
'require-atomic-updates': 2,
'no-empty': 2,
'no-case-declarations': 2,
// 追加的几条规则
'no-use-before-define': 0, // 未定义前不能使用
'no-new': 0,
'new-cap': 0,
'global-require': 0,
'consistent-return': 0, // return 后面是否允许省略
'no-underscore-dangle': 0, // 标识符不能以_开头或结尾;如果使用react的规则的话,我们有这个规则
'no-unused-expressions': 1, // 禁止无用的表达式
'no-unused-vars': 1, // 非TS项目,此项需设为1
'no-undef': 0,
'no-empty-function': 2,
'no-shadow': 2,
'curly': 2,
'array-callback-return': 2,
'block-scoped-var': 2,
'default-case': 2,
'complexity': ['error', { 'max': 20 }],
'no-console': 0,
'no-await-in-loop': 2,
'no-prototype-builtins': 0,
'no-useless-escape': 0,
'no-self-assign': 0,
'no-caller': 2,
'no-div-regex': 2,
'no-new-wrappers': 2,
'no-return-assign': 2,
'no-unmodified-loop-condition': 2,
'require-await': 2,
'require-atomic-updates': 2,
'no-empty': 2,
'no-case-declarations': 2,
// 追加的几条规则
'no-use-before-define': 0, // 未定义前不能使用
'no-new': 0,
'new-cap': 0,
'global-require': 0,
'consistent-return': 0, // return 后面是否允许省略
'no-underscore-dangle': 0, // 标识符不能以_开头或结尾;如果使用react的规则的话,我们有这个规则
'no-unused-expressions': 1, // 禁止无用的表达式

// 8.53.0废弃的样式相关规则
"array-bracket-newline": 0,
"array-bracket-spacing": 0,
"array-element-newline": 0,
"arrow-parens": 0,
"arrow-spacing": 0,
"block-spacing": 0,
"brace-style": 0,
"comma-dangle": 0,
"comma-spacing": 0,
"comma-style": 0,
"computed-property-spacing": 0,
"dot-location": 0,
"eol-last": 0,
"func-call-spacing": 0,
"function-call-argument-newline": 0,
"function-paren-newline": 0,
"generator-star-spacing": 0,
"implicit-arrow-linebreak": 0,
"indent": 0,
"jsx-quotes": 0,
"key-spacing": 0,
"keyword-spacing": 0,
"linebreak-style": 0,
"lines-between-class-members": 0,
"lines-around-comment": 0,
"max-len": 0,
"max-statements-per-line": 0,
"multiline-ternary": 0,
"new-parens": 0,
"newline-per-chained-call": 0,
"no-confusing-arrow": 0,
"no-extra-parens": 0,
"no-extra-semi": 0,
"no-floating-decimal": 0,
"no-mixed-operators": 0,
"no-mixed-spaces-and-tabs": 0,
"no-multi-spaces": 0,
"no-multiple-empty-lines": 0,
"no-tabs": 0,
"no-trailing-spaces": 0,
"no-whitespace-before-property": 0,
"nonblock-statement-body-position": 0,
"object-curly-newline": 0,
"object-curly-spacing": 0,
"object-property-newline": 0,
"one-var-declaration-per-line": 0,
"operator-linebreak": 0,
"padded-blocks": 0,
"padding-line-between-statements": 0,
"quote-props": 0,
"quotes": 0,
"rest-spread-spacing": 0,
"semi": 0,
"semi-spacing": 0,
"semi-style": 0,
"space-before-blocks": 0,
"space-before-function-paren": 0,
"space-in-parens": 0,
"space-infix-ops": 0,
"space-unary-ops": 0,
"spaced-comment": 0,
"switch-colon-spacing": 0,
"template-curly-spacing": 0,
"template-tag-spacing": 0,
"wrap-iife": 0,
"wrap-regex": 0,
"yield-star-spacing": 0
},
}
Loading

0 comments on commit e6b95df

Please sign in to comment.