hn.today

Show HN: Deslop – Oxlint rules for AI-generated TypeScript

github.com22 points5 comments
Screenshot of Show HN: Deslop – Oxlint rules for AI-generated TypeScript

This is an opinionated Oxlint plugin that enforces rules to reject low-evidence, low-signal TypeScript produced by AI assistants. It’s packaged as a dev dependency and ships compiled JavaScript so it runs on Bun, Deno, or Node; the runtime requires @oxlint/plugins to match your oxlint version. Configuration imports the plugin’s recommended config and options and activates its rules under a deslop namespace, making it straightforward to add as a linting layer in TypeScript projects that want stricter guarantees against sloppy AI-generated patterns.

The rule set is organized around type safety/evidence, code quality/APIs, and tests. Recommended rules block unsafe type assertions and widen-then-assert patterns, disallow unknown/unsafe parameter and return types, forbid conditional object-spread tricks, and ban common API misuses like Reflect.apply/get and adjacent eager filter/map sequences. Test-focused rules flag assertions that merely check mock calls, module mocking, and weak substring-based tests. There are opt-in fixes for duplicate consts/types, renamed imports, and Tailwind class canonicalization, plus documentation for opt-in behavior. Many rules are vendored from an anti-slop collection under MIT, and the recommended config also enables several standard TypeScript rules (no-floating-promises, no-unnecessary-condition, etc.) for stronger type-aware linting.

Read on github.com5 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

your C is not standard C

your C is not standard C

Standard C has many incompatibilities with how C is implemented in real-world compilers like gcc and clang, leading to non-conformance by default. These differences include handling of asm keywords, floating-point rounding modes, and support for standard pragmas, which are often ignored or unsupported by compilers. (sebsite.pw)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.