Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 12
[codex] align API and session-sync compliance boundaries#420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| export const effectMigrationWarnings = [ | ||
| { | ||
| selector: "SwitchStatement", | ||
| message: "Effect migration blocker: use Match.exhaustive instead of switch." | ||
| }, | ||
| { | ||
| selector: "TryStatement", | ||
| message: "Effect migration blocker: use Effect.try / Effect.catch* instead of try/catch." | ||
| }, | ||
| { | ||
| selector: "AwaitExpression", | ||
| message: "Effect migration blocker: use Effect.gen / Effect.flatMap instead of await." | ||
| }, | ||
| { | ||
| selector: "FunctionDeclaration[async=true], FunctionExpression[async=true], ArrowFunctionExpression[async=true]", | ||
| message: "Effect migration blocker: use Effect.gen / Effect.tryPromise instead of async functions." | ||
| }, | ||
| { | ||
| selector: "NewExpression[callee.name='Promise']", | ||
| message: "Effect migration blocker: use Effect.async / Effect.tryPromise instead of new Promise." | ||
| }, | ||
| { | ||
| selector: "CallExpression[callee.object.name='Promise']", | ||
| message: "Effect migration blocker: use Effect combinators instead of Promise.*." | ||
| } | ||
| ] | ||
| export const effectPromiseRestrictedTypes = { | ||
| types: { | ||
| Promise: { | ||
| message: "Effect migration blocker: avoid Promise in public types. Use Effect.Effect<A, E, R>." | ||
| }, | ||
| "Promise<*>": { | ||
| message: "Effect migration blocker: avoid Promise<T>. Use Effect.Effect<T, E, R>." | ||
| } | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| // CHANGE: add API-local Effect-TS compliance lint profile. | ||
| // WHY: expose Effect migration blockers in the API package, which previously only ran baseline ESLint. | ||
| // QUOTE(TZ): "packages/api не защищён lint:effect" | ||
| // REF: user-request-2026-06-17-effect-compliance-api | ||
| // SOURCE: n/a | ||
| // FORMAT THEOREM: lint(api) = hard unsafe bypass errors + visible Effect migration blockers | ||
| // PURITY: SHELL | ||
| // EFFECT: eslint config | ||
| // INVARIANT: config does not alter runtime behavior. | ||
| // COMPLEXITY: O(1)/O(1) | ||
| import eslintComments from "@eslint-community/eslint-plugin-eslint-comments" | ||
| import globals from "globals" | ||
| import tseslint from "typescript-eslint" | ||
| import { effectMigrationWarnings, effectPromiseRestrictedTypes } from "../../eslint.effect-ts-shared.mjs" | ||
| export default tseslint.config({ | ||
| name: "api-effect-ts-compliance", | ||
| files: ["src/**/*.ts", "tests/**/*.ts"], | ||
| languageOptions: { | ||
| parser: tseslint.parser, | ||
| globals: { ...globals.node } | ||
| }, | ||
| plugins: { | ||
| "@typescript-eslint": tseslint.plugin, | ||
| "eslint-comments": eslintComments | ||
| }, | ||
| rules: { | ||
| "@typescript-eslint/ban-ts-comment": ["error", { | ||
| "ts-check": false, | ||
| "ts-expect-error": true, | ||
| "ts-ignore": true, | ||
| "ts-nocheck": true | ||
| }], | ||
| "@typescript-eslint/no-explicit-any": "error", | ||
| "@typescript-eslint/no-restricted-types": ["warn", effectPromiseRestrictedTypes], | ||
| "eslint-comments/disable-enable-pair": "error", | ||
| "eslint-comments/no-unlimited-disable": "error", | ||
| "eslint-comments/no-unused-disable": "error", | ||
| "eslint-comments/no-use": "error", | ||
| "no-console": "error", | ||
| "no-restricted-syntax": ["warn", ...effectMigrationWarnings] | ||
| } | ||
| }) |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.