import js from "@eslint/js" import tseslint from "typescript-eslint" import unusedImports from "eslint-plugin-unused-imports" export default tseslint.config( { ignores: ["node_modules/**", "dist/**", ".repos/**", "*.frame.txt", "*.ansi"], }, js.configs.recommended, ...tseslint.configs.recommendedTypeChecked, { files: ["**/*.ts", "**/*.tsx"], languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, plugins: { "unused-imports": unusedImports, }, rules: { // Boundary code bans these; the Solid view follows TS-strict but is not Effect. "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/consistent-type-imports": ["error", { prefer: "type-imports" }], "@typescript-eslint/no-unused-vars": "off", "@typescript-eslint/no-non-null-assertion": "error", "unused-imports/no-unused-imports": "error", "unused-imports/no-unused-vars": [ "error", { vars: "all", varsIgnorePattern: "^_", args: "after-used", argsIgnorePattern: "^_" }, ], // --- Type-aware, high-value: ON as ERROR --- "@typescript-eslint/no-floating-promises": "error", "@typescript-eslint/no-misused-promises": "error", "@typescript-eslint/await-thenable": "error", // --- Phase 2: promote to error after Schema decode replaces the casts --- // The cast/`unknown` family fires on the `as`/`unknown` boundary code that // Phase 2 will replace with Schema decoding. Deferred to 'warn' so the gate // stays green (eslint exits 0 on warnings) without masking the real signal. "@typescript-eslint/no-unsafe-assignment": "warn", "@typescript-eslint/no-unsafe-member-access": "warn", "@typescript-eslint/no-unsafe-argument": "warn", "@typescript-eslint/no-unsafe-return": "warn", "@typescript-eslint/no-unsafe-call": "warn", "@typescript-eslint/no-unnecessary-condition": "warn", "@typescript-eslint/no-base-to-string": "warn", "@typescript-eslint/restrict-template-expressions": "warn", // `no-unnecessary-type-assertion` is the cast family (the one site is a // `effect as Effect.Effect<…>` test cast); `require-await` fires only on // async test-mock fns satisfying an async signature. Both are recommended // -TypeChecked errors by default — demote to 'warn' to keep the gate green // until Phase 2 (Schema decode) removes the casts. "@typescript-eslint/no-unnecessary-type-assertion": "warn", "@typescript-eslint/require-await": "warn", }, }, { // Tests keep their `!` non-null assertions (fixtures with known-present data). files: ["**/*.test.ts", "**/*.test.tsx"], rules: { "@typescript-eslint/no-non-null-assertion": "off", }, }, { // The eslint flat config is JS-only; the typed parser project service does not // cover it, so disable type-checking there to avoid parser errors. files: ["eslint.config.mjs"], ...tseslint.configs.disableTypeChecked, }, )