39fe248f9f
- 新增 .claude/skills/new-project/SKILL.md(标准 skill 格式) - install-skill.sh 安装时组装 SKILL.md + verify.sh,单一源无重复 - verify.sh 改用索引数组替代 declare -A,兼容 macOS bash 3.2 - log_pass/log_skip 显式 return 0,避免 set -e 下非 verbose 误退出 - README 改为 skill 优先;补全 copier.yml/scripts/template 入库
39 lines
1.3 KiB
Django/Jinja
39 lines
1.3 KiB
Django/Jinja
import js from "@eslint/js";
|
||
import globals from "globals";
|
||
import reactHooks from "eslint-plugin-react-hooks";
|
||
import reactRefresh from "eslint-plugin-react-refresh";
|
||
import tseslint from "typescript-eslint";
|
||
|
||
export default tseslint.config(
|
||
{ ignores: ["dist"] },
|
||
{
|
||
extends: [js.configs.recommended, ...tseslint.configs.strict],
|
||
files: ["**/*.{ts,tsx}"],
|
||
languageOptions: {
|
||
ecmaVersion: 2022,
|
||
globals: globals.browser,
|
||
},
|
||
plugins: {
|
||
"react-hooks": reactHooks,
|
||
"react-refresh": reactRefresh,
|
||
},
|
||
rules: {
|
||
...reactHooks.configs.recommended.rules,
|
||
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
||
// 禁 console.log(允许 warn/error)
|
||
"no-console": ["error", { allow: ["warn", "error"] }],
|
||
// 禁 any
|
||
"@typescript-eslint/no-explicit-any": "error",
|
||
// 命名约定
|
||
"@typescript-eslint/naming-convention": [
|
||
"error",
|
||
{ selector: "variable", format: ["camelCase", "UPPER_CASE", "PascalCase"] },
|
||
{ selector: "function", format: ["camelCase", "PascalCase"] },
|
||
{ selector: "typeLike", format: ["PascalCase"] },
|
||
],
|
||
// 单文件行数上限
|
||
"max-lines": ["warn", { max: 200, skipBlankLines: true, skipComments: true }],
|
||
},
|
||
}
|
||
);
|