Local main had only the video work; this brings in everything released since (freelance page, story order, phone layout, share image) plus the two unreleased commits, so the local site shows the current state. Also fixes the pre-commit hook for this checkout: ESLint walked into the worktrees under .claude/worktrees and found several tsconfig roots, so every commit from here failed. The worktrees are now ignored and the parser has a fixed tsconfig root. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
94 lines
2.8 KiB
JavaScript
94 lines
2.8 KiB
JavaScript
import js from "@eslint/js";
|
|
import tseslint from "typescript-eslint";
|
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
import reactPlugin from "eslint-plugin-react";
|
|
import hooksPlugin from "eslint-plugin-react-hooks";
|
|
import { FlatCompat } from "@eslint/eslintrc";
|
|
import { fixupPluginRules } from "@eslint/compat";
|
|
import { dirname } from "path";
|
|
import { fileURLToPath } from "url";
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = dirname(__filename);
|
|
|
|
const compat = new FlatCompat({
|
|
baseDirectory: __dirname,
|
|
});
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [
|
|
"**/dist/**",
|
|
"**/node_modules/**",
|
|
"**/.next/**",
|
|
"**/out/**",
|
|
"**/cloned-websites/**",
|
|
"**/public/showcase/**",
|
|
"**/.stryker-tmp/**",
|
|
"**/reports/**",
|
|
"**/coverage/**",
|
|
// Worktrees are separate checkouts; each is linted from its own root.
|
|
"**/.claude/**",
|
|
],
|
|
},
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
{
|
|
// Worktrees under .claude/worktrees are checkouts with their own tsconfig.
|
|
// Without a fixed root the parser cannot decide which one a file belongs to.
|
|
languageOptions: { parserOptions: { tsconfigRootDir: __dirname } },
|
|
},
|
|
{
|
|
files: ["apps/web/**/*.{js,jsx,ts,tsx}"],
|
|
plugins: {
|
|
react: fixupPluginRules(reactPlugin),
|
|
"react-hooks": fixupPluginRules(hooksPlugin),
|
|
"@next/next": fixupPluginRules(nextPlugin),
|
|
},
|
|
rules: {
|
|
...reactPlugin.configs.recommended.rules,
|
|
...nextPlugin.configs.recommended.rules,
|
|
...nextPlugin.configs["core-web-vitals"].rules,
|
|
"react/react-in-jsx-scope": "off",
|
|
"react/no-unescaped-entities": "off",
|
|
"react/prop-types": "off",
|
|
"@next/next/no-img-element": "warn",
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: "detect",
|
|
},
|
|
},
|
|
},
|
|
{
|
|
// Global overrides to keep the linter from blocking commits due to legacy debt
|
|
plugins: {
|
|
react: fixupPluginRules(reactPlugin),
|
|
"typescript-eslint": tseslint.plugin,
|
|
},
|
|
rules: {
|
|
"no-unused-vars": "off",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
"no-console": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
|
"no-empty": "warn",
|
|
"react/jsx-key": "warn",
|
|
"no-undef": "off", // Global recommended no-undef can be very noisy in monorepos
|
|
"prefer-const": "off",
|
|
"no-useless-escape": "off",
|
|
"no-self-assign": "off",
|
|
"no-control-regex": "off",
|
|
"@typescript-eslint/no-require-imports": "off",
|
|
"no-useless-assignment": "off",
|
|
},
|
|
},
|
|
);
|