/** * @factory/config — base ESLint config (eslintrc-compatible shape, matches * ROOT/.eslintrc.json which the repo currently uses). * * Exported as the default export of an ESM module (this package is * `type: module`) so packages/apps can compose it: * * ```js * import factoryBase from "@factory/config/eslint.base.js"; * ``` * * The `@typescript-eslint/*` parser/plugin entries reference packages that * are devDependencies of the ROOT (hoisted by pnpm) — no extra dependencies * in this package. */ const factoryBase = { parser: "@typescript-eslint/parser", parserOptions: { ecmaVersion: 2022, sourceType: "module", }, plugins: ["@typescript-eslint"], extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], env: { node: true, es2022: true, }, ignorePatterns: ["node_modules", "dist", "build", ".next", "coverage", "prisma/generated"], rules: { // Security / footguns "no-eval": "error", "no-implied-eval": "error", "no-new-func": "error", "no-unsafe-negation": "error", "no-prototype-builtins": "error", "no-var": "error", "prefer-const": "error", eqeqeq: ["error", "smart"], "no-debugger": "error", // Style shared across the repo "no-console": ["warn", { allow: ["warn", "error"] }], "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-unused-vars": [ "warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, ], }, overrides: [ { files: ["**/*.test.ts", "**/*.test.tsx", "**/*.spec.ts"], rules: { "@typescript-eslint/no-explicit-any": "off", }, }, ], }; export default factoryBase;