Skip to content

v0.25.0

Choose a tag to compare

@github-actions github-actions released this 01 Oct 12:00
· 13 commits to main since this release
06b12e8

Minor Changes

  • 0731395 Thanks @cevr! - noAs also reports the angle-bracket assertion <T>x of .ts files, with the same message and the same exemption: <const>x stays allowed like as const. Until now only typescript/no-unsafe-type-assertion held that spelling, so a project kept it on as a second owner of assertions.

  • 61301f1 Thanks @cevr! - New recommended rule noLocaleCompare: it reports localeCompare on any receiver (a.localeCompare(b), a["localeCompare"]) and Intl.Collator called or constructed through any spelling of the global (new Intl.Collator(), Intl.Collator(), globalThis.Intl.Collator, an alias or destructure of Intl). Both order by the locale and ICU data of the running process, so the same input sorts differently on another machine; output that must be stable, such as prompt bytes and listings, uses Order.String, which orders by UTF-16 code unit.

  • 504175a Thanks @cevr! - New recommended rule noModulePathFacts: a module's file path comes from the Effect Path service's Path.fromFileUrl(new URL("./x.ts", import.meta.url)). It reports the host path facts import.meta.dirname, import.meta.filename, import.meta.dir and import.meta.path; .pathname read off a new URL(...) that takes import.meta.url as any argument, inline or held in a const; and .slice, .substring or .replace on import.meta.url or on such a URL's .href. A hand-read pathname keeps percent-escapes and, on Windows, a leading /C:. import.meta.url alone, import.meta.main, and passing the URL to any function stay allowed. Host adapter files turn the rule off with an override.

  • f4c4f6a Thanks @cevr! - New recommended rule noRepoTempDirectory: a test's temp directory lives in the system temp directory. A temp directory under the repo that a killed test leaves behind is linted and scanned as source, and parallel runs share it. In test code it reports a temp directory call (mkdtemp, mkdtempSync, makeTempDirectory, makeTempDirectoryScoped) whose argument, or options object, roots it in the repo (import.meta.dir, import.meta.dirname, __dirname, process.cwd(), a join/resolve of a relative literal, a relative directory literal, or a const/let bound to one); a node mkdtemp with a relative prefix such as mkdtempSync("case-"); and a repo path joined to a tmp/temp segment (join(import.meta.dir, ".tmp")).

  • 71b98b5 Thanks @cevr! - New recommended rule noSharedTestHome: a test's home, data and working directory are its own. A fixed path under the shared temp root (/tmp, /var/tmp, /private/tmp, /dev/shm, or tmpdir()) given to a home key is shared by every run and parallel suite, so a result depends on run order. The rule reads the value of an object property, JSX attribute, binding, parameter default, class field or assignment (process.env.HOME = "/tmp") named home, HOME, homeDir, homeDirectory, dataDir, cwd or any …Cwd, plus the names the keys option adds, and reports it unless the value makes a unique directory (mkdtemp*, makeTempDirectory*). Test code is read whole; other files only inside a test layer (static Test, a …TestLayer binding, a Test: key).

  • b34fd73 Thanks @cevr! - New recommended rule requireForceKillAfter: every ChildProcess.make command names forceKillAfter. When a child's scope closes, the platform spawner sends SIGTERM, waits one second, and then waits for exit with no bound unless forceKillAfter is set, so a child that ignores SIGTERM holds its scope open forever. The rule reads make from effect/process (ChildProcess.make, P.ChildProcess.make) and effect/process/ChildProcess (a namespace or the named make under any alias). It reports a command with no options, an options object literal (inline, held in a const, or spread from one) without forceKillAfter, and the bare template form make`cmd` , which cannot carry options; write make({ forceKillAfter: "5 seconds" })`cmd` . Options it cannot see, such as a parameter, stay allowed.