48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import js from "@eslint/js";
|
|
import nextPlugin from "@next/eslint-plugin-next";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import security from "eslint-plugin-security";
|
|
import unusedImports from "eslint-plugin-unused-imports";
|
|
import tseslint from "typescript-eslint";
|
|
|
|
export default tseslint.config(
|
|
{
|
|
ignores: ["node_modules", ".next", "dist", "build"],
|
|
},
|
|
js.configs.recommended,
|
|
tseslint.configs.recommended,
|
|
{
|
|
files: ["src/**/*.{ts,tsx}", "pages/**/*.{ts,tsx}", "app/**/*.{ts,tsx}"],
|
|
plugins: {
|
|
"unused-imports": unusedImports,
|
|
security: security,
|
|
"react-hooks": reactHooks,
|
|
"@next/next": nextPlugin,
|
|
},
|
|
rules: {
|
|
// Laad automatisch alle aanbevolen beveiligings- en framework-regels in
|
|
...security.configs.recommended.rules,
|
|
...reactHooks.configs.recommended.rules,
|
|
...nextPlugin.configs.recommended.rules,
|
|
|
|
// Zorg dat variabelen die beginnen met een underscore (_req) genegeerd worden
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
"unused-imports/no-unused-vars": [
|
|
"error",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
|
|
"no-console": "warn",
|
|
},
|
|
},
|
|
);
|