Skip to content

Commit

Permalink
🔧 在eslintrc中添加分号和引号检查
Browse files Browse the repository at this point in the history
  • Loading branch information
neila-a committed Apr 20, 2024
1 parent eedcc78 commit 4a7f009
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
14 changes: 13 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
"rules": {
"@next/next/no-img-element": "off",
"react-hooks/rules-of-hooks": "error", // 检查 Hook 的规则
"react-hooks/exhaustive-deps": "off"
"react-hooks/exhaustive-deps": "off",
"semi": [
"warn",
"always"
],
"jsx-quotes": [
"warn",
"prefer-double"
],
"quotes": [
"warn",
"double"
]
}
}
10 changes: 4 additions & 6 deletions packages/core/src/app/index/getParamTools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ function getParamTools(mostUsed: mostUsedMarks, realTools: tool[], extensionTool
}
return 0;
}).slice(0, 3).map(item => {
const to = item[0],
// 不直接返回tool因为怕自动分号影响return
tool: tool | 0 = 0
|| realTools.find(single => single.to === to)
|| convertExtensionTools(extensionTools).find(single => `/tools/extension?tool=${to}` === single.to);
return tool as tool | 0;
const to = item[0];
return 0
|| realTools.find(single => single.to === to)
|| convertExtensionTools(extensionTools).find(single => `/tools/extension?tool=${to}` === single.to) as tool | 0;
}).filter(item => item !== 0 && item !== undefined) as unknown as tool[];
}
export default getParamTools;
3 changes: 0 additions & 3 deletions packages/core/src/app/tools/getToolColor.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"use client";
import {
Hex
} from "declare";
import {
tool
} from "./info";
Expand Down

0 comments on commit 4a7f009

Please sign in to comment.