feat(project): init

This commit is contained in:
zhangheng
2026-04-25 11:26:33 +08:00
commit 9bf212f67c
63 changed files with 11141 additions and 0 deletions

68
eslint.config.mjs Normal file
View File

@@ -0,0 +1,68 @@
import js from "@eslint/js";
import nextPlugin from "@next/eslint-plugin-next";
import tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";
import reactHooks from "eslint-plugin-react-hooks";
import globals from "globals";
const sharedGlobals = {
...globals.browser,
...globals.node,
};
const nextRules = {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs["core-web-vitals"].rules,
"@next/next/no-img-element": "off",
};
export default [
{
ignores: ["node_modules/**", ".next/**", "out/**", "coverage/**"],
},
{
files: ["**/*.{js,mjs,cjs}"],
languageOptions: {
...js.configs.recommended.languageOptions,
globals: sharedGlobals,
},
plugins: {
"@next/next": nextPlugin,
"react-hooks": reactHooks,
},
rules: {
...js.configs.recommended.rules,
...nextRules,
...reactHooks.configs.recommended.rules,
},
},
{
files: ["**/*.{ts,tsx}"],
languageOptions: {
parser: tsParser,
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
globals: sharedGlobals,
},
plugins: {
"@next/next": nextPlugin,
"@typescript-eslint": tsPlugin,
"react-hooks": reactHooks,
},
rules: {
...tsPlugin.configs.recommended.rules,
...nextRules,
...reactHooks.configs.recommended.rules,
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
},
],
},
},
];