71 lines
1.7 KiB
JavaScript
71 lines
1.7 KiB
JavaScript
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";
|
|
import pluginRouter from "@tanstack/eslint-plugin-router";
|
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [
|
|
".agents/**",
|
|
"ansible/**",
|
|
"dist/**",
|
|
".tanstack/**",
|
|
".output/**",
|
|
".vinxi/**",
|
|
".pb/**",
|
|
"node_modules/**",
|
|
"public/**",
|
|
"src/routeTree.gen.ts",
|
|
],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
...pluginRouter.configs["flat/recommended"],
|
|
{
|
|
files: ["**/*.{js,mjs,cjs}"],
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.node,
|
|
},
|
|
},
|
|
},
|
|
{
|
|
files: ["src/**/*.{ts,tsx}"],
|
|
languageOptions: {
|
|
ecmaVersion: 2022,
|
|
globals: globals.browser,
|
|
},
|
|
plugins: {
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
},
|
|
rules: {
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react-hooks/exhaustive-deps": "warn",
|
|
"react-refresh/only-export-components": [
|
|
"warn",
|
|
{ allowConstantExport: true },
|
|
],
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
// Route files export `Route` alongside components for TanStack Start / Router
|
|
files: ["src/app/**/*.{ts,tsx}"],
|
|
rules: {
|
|
"react-refresh/only-export-components": "off",
|
|
},
|
|
},
|
|
eslintConfigPrettier,
|
|
);
|