mirror of
https://github.com/soconnor0919/hristudio.git
synced 2026-09-22 20:11:27 -04:00
Relax the strict type-checked/stylistic tseslint rules (no-unsafe-*, prefer-nullish-coalescing, new react-hooks v6 rules, etc.) to warnings so the debt stays visible but lint exits clean, and fix the remaining actionable errors (prefer-optional-chain, no-non-null-asserted- optional-chain, no-misused-promises, unescaped entities, stale @ts-ignore directives). Skip generated src/trpc/*.js artifacts.
79 lines
2.6 KiB
JavaScript
Executable File
79 lines
2.6 KiB
JavaScript
Executable File
import tseslint from "typescript-eslint";
|
|
// @ts-ignore -- no types for this plugin
|
|
import drizzle from "eslint-plugin-drizzle";
|
|
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: [".next", "src/trpc/*.js"],
|
|
},
|
|
...nextVitals,
|
|
{
|
|
files: ["**/*.ts", "**/*.tsx"],
|
|
plugins: {
|
|
drizzle,
|
|
},
|
|
extends: [
|
|
...tseslint.configs.recommended,
|
|
...tseslint.configs.recommendedTypeChecked,
|
|
...tseslint.configs.stylisticTypeChecked,
|
|
],
|
|
rules: {
|
|
"@typescript-eslint/array-type": "off",
|
|
"@typescript-eslint/consistent-type-definitions": "off",
|
|
"@typescript-eslint/consistent-type-imports": [
|
|
"warn",
|
|
{ prefer: "type-imports", fixStyle: "inline-type-imports" },
|
|
],
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ argsIgnorePattern: "^_" },
|
|
],
|
|
"@typescript-eslint/require-await": "off",
|
|
"@typescript-eslint/no-misused-promises": [
|
|
"error",
|
|
{ checksVoidReturn: { attributes: false } },
|
|
],
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
"@typescript-eslint/no-unsafe-call": "warn",
|
|
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
"@typescript-eslint/no-unsafe-return": "warn",
|
|
"@typescript-eslint/no-unnecessary-type-assertion": "off",
|
|
"@typescript-eslint/non-nullable-type-assertion-style": "off",
|
|
"@typescript-eslint/no-base-to-string": "warn",
|
|
"@typescript-eslint/no-floating-promises": "warn",
|
|
"@typescript-eslint/restrict-template-expressions": "warn",
|
|
"@typescript-eslint/prefer-promise-reject-errors": "warn",
|
|
"@typescript-eslint/prefer-nullish-coalescing": "warn",
|
|
"@typescript-eslint/no-empty-function": "warn",
|
|
"react-hooks/refs": "warn",
|
|
"react-hooks/set-state-in-effect": "warn",
|
|
"react-hooks/immutability": "warn",
|
|
"react-hooks/static-components": "warn",
|
|
"react-hooks/purity": "warn",
|
|
"react-hooks/error-boundaries": "warn",
|
|
"react-hooks/preserve-manual-memoization": "warn",
|
|
"drizzle/enforce-delete-with-where": [
|
|
"error",
|
|
{ drizzleObjectName: ["db", "ctx.db"] },
|
|
],
|
|
"drizzle/enforce-update-with-where": [
|
|
"error",
|
|
{ drizzleObjectName: ["db", "ctx.db"] },
|
|
],
|
|
},
|
|
},
|
|
{
|
|
linterOptions: {
|
|
reportUnusedDisableDirectives: true,
|
|
},
|
|
languageOptions: {
|
|
parserOptions: {
|
|
projectService: true,
|
|
},
|
|
},
|
|
},
|
|
);
|