Loading...
Loading...
TypeScript and JavaScript standards. Use when writing TS/JS code. Covers strict mode, type patterns, error handling, imports, naming, testing, React conventions, and package management with bun.
npx skill4agent add lgtm-hq/ai-skills stand-tsbunnpmbun installnpm installbun runnpm runbunxnpxstrict: truetsconfig.jsonanyinterfacetypesatisfiesasenumas const// Good
const Status = {
Active: "active",
Inactive: "inactive",
} as const;
type Status = (typeof Status)[keyof typeof Status];
// Avoid
enum Status {
Active = "active",
Inactive = "inactive",
}unknownany// Good
catch (err: unknown) {
if (err instanceof SpecificError) { ... }
}
// Bad
catch (err: any) { ... }Result<T, E>import type { Foo } from "./foo";index.tsPascalCasecamelCaseUPPER_SNAKE_CASEishasshouldcanstand-pylintdescribebeforeEachafterEachit.eachtest.each// Good
describe("parseConfig", () => {
it("returns defaults for empty input", () => {
expect(parseConfig({})).toEqual(defaults);
});
it.each([
{ input: "yes", expected: true },
{ input: "no", expected: false },
])("parses '$input' as $expected", ({ input, expected }) => {
expect(parseBoolean(input)).toBe(expected);
});
});export default