-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc9ff09
commit 6bb7f42
Showing
80 changed files
with
1,954 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,38 @@ | ||
import optimizeRegex from "eslint-plugin-optimize-regex" | ||
import optimizeRegex from 'eslint-plugin-optimize-regex' | ||
|
||
export default [ | ||
{ | ||
plugins: { | ||
"optimize-regex": optimizeRegex | ||
'optimize-regex': optimizeRegex | ||
}, | ||
ignores: ["**/dist/*"], | ||
ignores: ['**/dist/*'], | ||
rules: { | ||
// 移除多余的分号 | ||
semi: [ | ||
"error", "never" | ||
'error', 'never' | ||
], | ||
// 当块内容只有一行时,移除块的大括号 | ||
curly: ["error", "multi"], | ||
curly: ['error', 'multi'], | ||
// tab 缩进 | ||
indent: ["error", "tab", { | ||
indent: ['error', 'tab', { | ||
VariableDeclarator: 1, | ||
MemberExpression: 1, | ||
SwitchCase: 1, | ||
ignoredNodes: [ | ||
'ConditionalExpression' | ||
] | ||
}], | ||
// 鼓励单引号 | ||
quotes: ['error', 'single'], | ||
// 去除不必要小括号 | ||
"no-extra-parens": ["error", "all", { | ||
"nestedBinaryExpressions": false, // 允许嵌套二元表达式中有括号 | ||
"returnAssign": false // 允许 return 语句中的赋值表达式中有括号 | ||
'no-extra-parens': ['error', 'all', { | ||
nestedBinaryExpressions: false, // 允许嵌套二元表达式中有括号 | ||
returnAssign: false // 允许 return 语句中的赋值表达式中有括号 | ||
}], | ||
"optimize-regex/optimize-regex": "warn" | ||
// if中的没有await的promise | ||
'no-constant-condition': ['error', { checkLoops: false }], | ||
// 优化正则 | ||
'optimize-regex/optimize-regex': 'warn' | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.