mirror of
https://github.com/gogs/gogs.git
synced 2026-05-28 21:30:36 +00:00
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import js from "@eslint/js";
|
|
import importPlugin from "eslint-plugin-import";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
export default [
|
|
{
|
|
ignores: ["dist", "eslint.config.js", ".prettierrc.js", "vite.config.ts", "scripts/**"],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommendedTypeChecked,
|
|
importPlugin.flatConfigs.recommended,
|
|
importPlugin.flatConfigs.typescript,
|
|
{
|
|
rules: {
|
|
"import/no-unresolved": "off",
|
|
},
|
|
},
|
|
{
|
|
files: ["**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
parser: tseslint.parser,
|
|
parserOptions: {
|
|
projectService: true,
|
|
tsconfigRootDir: import.meta.dirname,
|
|
ecmaVersion: "latest",
|
|
sourceType: "module",
|
|
},
|
|
globals: {
|
|
document: "readonly",
|
|
window: "readonly",
|
|
},
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
},
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
},
|
|
},
|
|
];
|