Skip to content

Commit d95e6b3

Browse files
🔧 chore(config): 更新 eslint 配置并移除 package-lock.json
- 新增 eslint 配置以支持 TypeScript - 移除 package-lock.json,使用 pnpm 管理依赖
1 parent 16b9a09 commit d95e6b3

10 files changed

+498
-23021
lines changed

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
2+
npx lint-staged
33

44
echo "\033[33m ------------------- 正在校验提交信息格式 -------------------- \033[0m"
55
npx --no-install commitlint --edit ${1}

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
2+
npx lint-staged
33

44
echo "\033[33m ------------------- 正在执行eslint校验 -------------------- \033[0m"
55
npx --no-install lint-staged

eslint.config.mjs

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import stylisticTs from "@stylistic/eslint-plugin-ts";
2+
import parserTs from "@typescript-eslint/parser";
3+
4+
export default [
5+
{
6+
ignores: ["**/out", "**/dist", "**/*.d.ts"],
7+
},
8+
{
9+
files: ["src/**/*.ts"],
10+
plugins: {
11+
"@stylistic/ts": stylisticTs,
12+
},
13+
14+
languageOptions: {
15+
parser: parserTs,
16+
ecmaVersion: 6,
17+
sourceType: "module",
18+
},
19+
20+
rules: {
21+
// "@stylistic/ts/naming-convention": [
22+
// "warn",
23+
// {
24+
// selector: "import",
25+
// format: ["camelCase", "PascalCase"],
26+
// },
27+
// ],
28+
29+
"@stylistic/ts/semi": "warn",
30+
curly: "warn",
31+
eqeqeq: "warn",
32+
"no-throw-literal": "warn",
33+
semi: "off",
34+
},
35+
},
36+
];

0 commit comments

Comments
 (0)