66 lines
1.7 KiB
JavaScript
66 lines
1.7 KiB
JavaScript
import js from "@eslint/js";
|
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
import prettier from "eslint-config-prettier";
|
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import security from "eslint-plugin-security";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
export default tseslint.config(
|
|
js.configs.recommended,
|
|
...tseslint.configs.recommended,
|
|
security.configs.recommended,
|
|
prettier,
|
|
{
|
|
plugins: {
|
|
"@next/next": nextPlugin,
|
|
"react-hooks": reactHooks,
|
|
"jsx-a11y": jsxA11y,
|
|
},
|
|
rules: {
|
|
...nextPlugin.configs.recommended.rules,
|
|
|
|
"react-hooks/rules-of-hooks": "error",
|
|
"react-hooks/exhaustive-deps": "warn",
|
|
|
|
"no-console": "off",
|
|
"no-unused-vars": "off",
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"warn",
|
|
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
|
],
|
|
"@typescript-eslint/no-explicit-any": "warn",
|
|
"@typescript-eslint/consistent-type-imports": "error",
|
|
"@typescript-eslint/no-non-null-assertion": "warn",
|
|
"prefer-const": "error",
|
|
"no-var": "error",
|
|
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
|
|
"no-empty": ["warn", { allowEmptyCatch: true }],
|
|
"no-useless-assignment": "off",
|
|
"no-undef": "off",
|
|
|
|
"security/detect-object-injection": "warn",
|
|
"security/detect-non-literal-fs-filename": "warn",
|
|
},
|
|
},
|
|
{
|
|
files: ["**/*.test.ts", "**/*.test.tsx", "scripts/**"],
|
|
rules: {
|
|
"security/detect-object-injection": "off",
|
|
"security/detect-non-literal-fs-filename": "off",
|
|
"@typescript-eslint/no-explicit-any": "off",
|
|
},
|
|
},
|
|
{
|
|
ignores: [
|
|
".next/",
|
|
"node_modules/",
|
|
"src/generated/",
|
|
"public/",
|
|
"prisma/migrations/",
|
|
"db_backup_*.sql",
|
|
],
|
|
},
|
|
);
|