Skip to content

Commit

Permalink
🔧 chore(config): 更新 eslint 配置并移除 package-lock.json
Browse files Browse the repository at this point in the history
- 新增 eslint 配置以支持 TypeScript
- 移除 package-lock.json,使用 pnpm 管理依赖
  • Loading branch information
littleCareless committed Jan 3, 2025
1 parent 16b9a09 commit d95e6b3
Show file tree
Hide file tree
Showing 10 changed files with 498 additions and 23,021 deletions.
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

echo "\033[33m ------------------- 正在校验提交信息格式 -------------------- \033[0m"
npx --no-install commitlint --edit ${1}
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
npx lint-staged

echo "\033[33m ------------------- 正在执行eslint校验 -------------------- \033[0m"
npx --no-install lint-staged
Expand Down
36 changes: 36 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import stylisticTs from "@stylistic/eslint-plugin-ts";
import parserTs from "@typescript-eslint/parser";

export default [
{
ignores: ["**/out", "**/dist", "**/*.d.ts"],
},
{
files: ["src/**/*.ts"],
plugins: {
"@stylistic/ts": stylisticTs,
},

languageOptions: {
parser: parserTs,
ecmaVersion: 6,
sourceType: "module",
},

rules: {
// "@stylistic/ts/naming-convention": [
// "warn",
// {
// selector: "import",
// format: ["camelCase", "PascalCase"],
// },
// ],

"@stylistic/ts/semi": "warn",
curly: "warn",
eqeqeq: "warn",
"no-throw-literal": "warn",
semi: "off",
},
},
];
Loading

0 comments on commit d95e6b3

Please sign in to comment.