Files
website/eslint.config.js
2026-09-06 11:17:54 +02:00

68 lines
1.9 KiB
JavaScript

// @ts-check
import js from "@eslint/js";
import { defineConfig, globalIgnores } from "eslint/config";
import globals from "globals";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import tseslint from "typescript-eslint";
import htmlEslint from "@html-eslint/eslint-plugin";
import customRules from "./eslint-rules/index.js";
export default defineConfig(
globalIgnores(["dist", ".agents"]),
{
name: "app/ts",
files: ["**/*.{ts,tsx}"],
extends: [
js.configs.recommended,
tseslint.configs.recommended,
reactHooks.configs.flat.recommended,
reactRefresh.configs.vite,
],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
linterOptions: {
reportUnusedDisableDirectives: "error",
},
plugins: {
custom: customRules,
},
rules: {
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"custom/no-placeholder-comments": "error",
"no-warning-comments": ["error", { terms: ["fixme"] }],
},
},
{
name: "app/html",
files: ["**/*.html"],
extends: [htmlEslint.configs["flat/recommended"]],
plugins: {
custom: customRules,
},
rules: {
"@html-eslint/require-meta-description": "error",
"@html-eslint/require-meta-viewport": "error",
"@html-eslint/require-open-graph-protocol": [
"error",
["og:type", "og:title", "og:description"],
],
// The manifest link below intentionally uses `rel="manifest"`; the
// baseline data currently flags this attribute value as not widely
// available, which is a false positive for our use case.
"@html-eslint/use-baseline": "off",
"custom/no-inline-script": "error",
"custom/require-webmanifest": "error",
},
},
);