Skip to content

Releases

v0.8.0

Choose a tag to compare

@github-actions github-actions released this 17 Nov 08:56
v0.8.0
4d3bdd7

Breaking changes

  • MCP lint takes include instead of rules, with the meaning of --include (rule IDs or knip issue types).
  • MCP explain_usage resolves file against the server's working directory, as skif explain-usage does, not
    against path.

Added

  • --format toon: the JSON report encoded as TOON (Token-Oriented Object Notation), with the same data.
  • MCP: lint takes config, no_config, include, exclude, workspace, strict and max_show_issues.
  • MCP: lint with fix or fix_unsafe (plus fix_type, select, allow_remove_files) returns the dry-run fix plan.
  • MCP: explain_usage explains a dependency (dependency, package) and takes config and no_config.
  • MCP: a config tool returns the effective configuration, as skif config --format json does.
  • skif::render re-exports the TOON error renderers beside the JSON ones.

Changed

  • The type checker is tsrs 7.1.0-beta.tsrs2 (was tsrs1), and the parser oxc 0.159; the type-aware.engine field of
    the JSON report names the new checker.
  • MCP: each tool argument is the skif flag of the same name, parsed by the command line itself.
  • npm: lint and lintAsync print the CLI's warnings to stderr, as skif does.
  • MCP: tool results carry compact JSON text instead of pretty-printed JSON, and tool descriptions are shorter.

Fixed

  • MCP: lint now honours [lint] require-ignore-reasons and the tsconfig checks, and sets isError when roots fail.
  • npm: lint and lintAsync now apply [lint] require-ignore-reasons and the tsconfig checks, as the CLI does.
  • --format toon: a usage error, an early error or a panic prints the error document in TOON, not nothing.
  • skif migrate: knip's --treat-tag-hints-as-errors is noted as approximate (tag hints are part of
    stale-js-config), as its treatTagHintsAsErrors key already was.

v0.7.0

Choose a tag to compare

@github-actions github-actions released this 17 Nov 06:02
v0.7.0
b2a21d3

Breaking changes

  • The npm package is @polylint/skif: its platform packages are @polylint/skif-<platform>, and skif-cli and
    skif-<platform> on npm are deprecated and receive no new versions. The command stays skif, and Windows x64 and
    arm64 now install from npm (ADR 0015).
  • skif moved to the polylint organization (ADR 0015): the
    repository is polylint/skif, the documentation is at https://polylint.github.io/skif/, the Action is
    polylint/skif@v0.M, Homebrew is brew install polylint/tap/skif and Scoop is
    scoop bucket add polylint https://github.com/polylint/scoop-bucket. skif init and skif migrate write the
    #:schema URL of polylint/skif, and SARIF output names it as the tool's information URI.

Added

  • --performance, --debug and SKIF_TIMINGS=1 split the time of the typed programs into config parse, program
    creation and bind, report the project files parsed against the distinct ones, and time the query build, the config
    hints, the ambient modules, the judged patterns and each JS rule. Timing lines are buffered and written once when
    the run ends, so printing them no longer serialises the threads of a recursive run.

Changed

  • Faster runs: the module graph parses the files it reaches ahead of its rounds and reuses each file's parse when it is
    built again, ** workspace globs are expanded in parallel, the pnpm lockfile parser skips the sections no rule
    reads, and child_process command analysis is built only when a command needs it. skif -r lints nested roots
    alongside their enclosing roots, with the same report. A typed run asks the checker only for escapes that can reach
    an asked declaration and for the ancestors only of classes with heritage, and reuses its parsed config for each
    program's own config. The programs of a typed run share each project source they read instead of parsing it once
    per program, which cuts babel's typed run by about a third. Release builds use fat LTO.
  • The Homebrew formula is bottled for macOS arm64 and Linux x86_64 and arm64.
  • The GitHub Action and the pre-commit launcher verify build attestations against polylint/skif, and still accept a
    release up to v0.6.0 attested by Goldziher/skif, the repository before the move.

Fixed

  • A webpack or rspack config built in a function that changes the config after its literal (config.module.rules.unshift(…)
    under a test) credits the loaders of the literal and of the change again, instead of reporting every loader as an
    unused dependency. A rule the evaluator cannot see leaves the package unjudged; one unknown
    entry in a known loader list (MiniCssExtractPlugin.loader) does not (#248).
  • @polylint/skif is never reported as an unused dependency.
  • A bundler alias or paths target in the build output of a workspace package (../lib/dist/index.js) stands for
    the source that output is built from whether or not the output exists, so the verdicts no longer depend on a local
    build (#251).
  • With SKIF_TIMINGS or --performance, --watch, skif lsp and skif mcp write the phase timings after each run
    or request, instead of holding them until the process exits, which an interrupted watcher never reached.
  • A webpack or rspack rule whose whole use or loader is computed (use: cssLoaders()), or a module the
    evaluator cannot read, leaves the package unjudged instead of judged without the loaders it may name. A use that
    is one of several known loaders credits each.

v0.6.0

Choose a tag to compare

@github-actions github-actions released this 16 Nov 06:04

Release v0.6.0

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 12:32

Install

pnpm add -D skif-cli                  # or npm install -D, yarn add -D, bun add -D
cargo binstall skif-cli               # or cargo install skif-cli
brew install goldziher/tap/skif
scoop bucket add goldziher https://github.com/Goldziher/scoop-bucket
scoop install skif

Docs: https://goldziher.github.io/skif/

Breaking changes

  • Public API: cargo-semver-checks against the 0.4.0 crates on crates.io reports
    semver requires new major version for skif-core (constructible_struct_adds_field: Tokens.empty_commands),
    skif-js-syntax (enum_marked_non_exhaustive and enum_no_repr_variant_discriminant_changed: ImportKind) and
    skif-js-plugins (constructible_struct_adds_field: PluginContext.members); the bullets below also list the
    breaks it does not flag.
  • Public API: skif-js-syntax's ImportKind gains Resolve (enum_variant_added) and is #[non_exhaustive],
    so a match on it outside the crate needs a wildcard arm, and later kinds are no longer a breaking change
    (#225).
  • Consumers of explain-usage --format json, explain-usage --dependency and --trace-dependency --format json:
    a require.resolve("x"), createRequire(…).resolve("x") or import.meta.resolve("x") is listed with the import
    kind resolve instead of require (#225).
  • Library users that build PluginContext of skif-js-plugins with a literal: it gains members, the
    directories of the run's other packages below the package, whose sources the execa, zx, nano-spawn and bun
    plugins leave out; &[] reads them all (#97).
  • Library users that build skif_core::shell::Tokens with a literal: it gains empty_commands, the commands of
    redirections alone (> "$(x)") as EmptyCommands (#97).
  • Library hosts that lint nested roots themselves: the files of other projects that a plugin names as build
    sources (a Bazel srcs) moved from Report::other_project_files to the new
    Report::other_project_build_sources. Pass those below the root, made relative to the nested root that owns them,
    to RunOptions::with_extra_build_sources of its run, and credit those outside it as the files of
    other_project_files are; a host that reads only other_project_files no longer makes them used
    (ADR 0034,
    #226).

Added

  • stale-js-config reports a plain entry or project pattern that cancels a pattern ending in ! of its list
    ([js] or a [js.workspaces] table): any plain pattern matching the file a ! pattern names, as in
    entry = ["src/**", "src/main.js!"], or the same glob as a ! glob. In a production run the plain pattern excludes
    what the ! one selects, while in a normal run the ! one selects it alone. The hint says to remove the plain
    pattern, or the ! one if the files are not production code. skif migrate --from knip keeps both patterns, since
    knip also excludes them in production mode (#227).

  • Public API (#206): PackageSources::within of skif-js-plugins
    makes a listing of a package's sources that shares the texts it reads with another listing, and
    WorkspaceListing::package_sources of skif-js makes one that shares them with the run's other packages.

  • Public API (#97): skif-js-syntax exports is_plain_word,
    shell_quote and shell_word, which quote a word of a command line as the command plugins do.

  • Public API (#226): the build sources a multi-root host hands a
    nested root. skif-core: Report::other_project_build_sources and Report::with_other_project_build_sources.
    skif-lint: Emitter::report_other_project_build_source, Emitter::take_other_project_build_sources,
    LintContext::extra_build_sources and RunOptions::with_extra_build_sources. skif:
    RunOptions::with_extra_build_sources.

Changed

  • Performance (#206): --watch scans the tree on up to four
    threads, so on a large repository it polls more often and sees a change sooner; scanning takes up to about four
    thirds of a core instead of a third. The files it compares are unchanged. The plugins that search a
    package's sources (pino, zx, execa, nano-spawn, bun) share the texts they read between all packages of a
    workspace and their Nx projects, so a source file is usually read once per workspace instead of once for every
    package or project that searches it (pino and the Bun. check of bun also search a member's sources from the
    root package, and every one of them searches an Nx project's sources from its package); packages resolved in
    parallel can still read the same file at the same time. The output is unchanged.

  • Performance (#224): evaluating a config that follows its imports
    parses and analyses a module inside a cycle of imports once per distinct set of answers its imports give, instead of
    at every entry; the analysis budget and the findings are unchanged. A change that reaches a whole class of linked
    bindings is applied to that class once instead of once per change. ModuleLoader::holds_no_code is asked once per
    importing directory and specifier, as is_installed already was.

  • Performance: the execa, zx, nano-spawn and bun plugins no longer walk the directories of a package's
    members when they list its own sources, so a workspace root lists only its own directories and each member lists
    its own, instead of the root walking every member's tree too; when a plugin of the package already listed every
    source (pino), the own sources are taken from that listing. The source texts a plugin searches are read in
    parallel, or one after the other on a single-threaded run (a library host sets it with the new
    PackageSources::sequential of skif-js-plugins). The output is unchanged.

  • Performance: the analysis of which bindings may share a changed object follows a change only where it can reach
    a binding the pass asks about, skips a change of a class of linked bindings an earlier change reached in full, and
    applies the getters, setters and iterators code may run implicitly once per list of them, so large bundled modules
    (a 2.8 MB GitHub Action bundle) parse several times faster. The output is unchanged.

Fixed

  • Resolve calls: require.resolve(x), createRequire(…).resolve(x) and import.meta.resolve(x) return a path
    and load nothing, so they no longer count as a use of every export of the module they name. The file they name stays
    in use, what it imports is followed, and a package they name is still a used dependency, but its exports are judged:
    unused-exports now reports the value exports nothing else imports (unused-types already reported its types, as a
    resolve call never credited them). A module otherwise read only through a namespace (ns.a) stays namespace-only,
    so its unread exports are unused-namespace-exports. A resolve call is no edge of circular-imports, and a module
    an extensionless JavaScript mise file task only resolves is used but no entry, so its exports are judged too. A
    computed relative specifier (require.resolve(`./tpl/${name}`)) is followed as a glob, as a computed require
    is, and the call is found behind a TypeScript assertion ((require as NodeRequire).resolve(x)). skif-js-syntax
    reports the call as ImportKind::Resolve, and the analysis cache is invalidated. knip reports nothing for these exports, so the
    findings are skif's alone (#225).
  • Nested roots under -r: a file of a nested root that an enclosing root's plugin names as a build source (a
    Bazel srcs of the outer BUILD file) is a build source of the nested root instead of an entry, so its unused
    exports are reported there, as they are for a build source of a workspace member; a file the enclosing root also
    imports or names as an entry stays an entry. A package of the nested root that such a build source belongs to is no
    longer taken as one another root imports, so unused-subpath-exports now judges its exports unless an enclosing
    root imports or runs one of its files
    (ADR 0034,
    #226).
  • explain-usage: an importer that uses no export says what it takes instead of the whole module: a resolve call
    its path, no export, a side-effect import runs it, no export and a test-runner mock a test-runner call, no export (#225).
  • unlisted-binaries: a node:child_process, execa, nano-spawn or Bun.spawn call with a literal argument that
    is not a plain word (execFileSync("sqlite3", [db, "select …"])) runs its program: the argument is one quoted word
    of the command instead of dropping the call, so the binary is judged. The analysis cache is invalidated
    (#97).
  • unlisted-binaries, unused-files: a computed argument of such a call ends its command, instead of being left
    out while the literals after it stay: spawn("node", [script, "out.js"]) no longer runs a file out.js. The
    analysis cache is invalidated (#97).
  • unlisted-binaries, unused-files: a short flag ...
Read more

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 14 Nov 06:22

Install

pnpm add -D skif-cli                  # or npm install -D, yarn add -D, bun add -D
cargo binstall skif-cli               # or cargo install skif-cli
brew install goldziher/tap/skif
scoop bucket add goldziher https://github.com/Goldziher/scoop-bucket
scoop install skif

Docs: https://goldziher.github.io/skif/

Breaking changes

  • Minimum supported Rust: raised to 1.100 for building the crates from source.
  • Public API: cargo-semver-checks against the 0.3.0 crates on crates.io reports
    semver requires new major version for skif-js-plugins (constructible_struct_adds_field: DepRef.dir;
    struct_pub_field_missing: ScriptInfo.turbo_tasks), skif-rules (enum_variant_added: ToolchainKind::Bazel) and
    skif-js (constructible_struct_adds_field: UnlistedBinary.runs_in); the bullets below also list the breaks it
    does not flag.
  • Embedders of skif-config: Js::isolate_workspaces is workspace isolation only. An embedder that set it for
    knip's strict mode sets Js::strict (with_strict), which implies production mode and isolation and adds the
    direct-dependency rules; JsAnalysis::strict follows strict. Js::production_mode and Js::isolated give the
    effective modes. Js gains strict, use_public_hoisting and compilers, so a struct literal of Js needs them
    (#221).
  • Implementers of skif_js_syntax::ModuleLoader: the trait gains is_installed and holds_no_code, both false
    by default. The evaluator takes a define… helper, a copying merge and a package whose methods keep nothing at their
    word only for a package the loader calls installed, so a loader that does not implement is_installed gets those
    calls as unknown; without a loader, every bare specifier counts as installed.
  • Library users that build these structs with literals or match these enums exhaustively: new public fields must be
    set. skif-js-plugins: DepRef gains dir and reader_lists, PluginContext gains globs (a GlobCache) and
    sources (an Option<&PackageSources>), and ScriptInfo::turbo_tasks is removed. skif-js: Module is
    #[non_exhaustive] (and gains is_build_source), UnlistedBinary gains runs_in, ConfigDependency gains span
    and reader_lists. skif-js-syntax: Export gains used_whole_in_file. skif-rules: ToolchainKind gains Bazel
    (ADR 0031).
  • Library users of skif-workspace: DependencyEntry::name and DependencyEntry::specifier are Arc<str> instead
    of String, so a consumer can keep a name without copying its text; read them as &str with &*entry.name, which
    also compares with a string (&*entry.name == "react") (#206).
  • Configurations with [js.workspaces.<dir>.paths]: a key or target with more than one * is a configuration
    error, a key without * maps only that specifier, and "alias/*" no longer maps the bare alias, as in TypeScript
    (#214).
  • Consumers of explain-usage --format json: a file loaded with new URL("./x", import.meta.url) is listed with
    the import kind url instead of require, a whole use of a module object is no longer listed as a user of its type
    exports, and the entry kinds enclosing-incomplete-scope, script (for the source of build output a script runs) and
    bin-stub replace unknown for the files they describe (ADR
    0125
    ,
    #165).

Added

  • [js] isolate-workspaces and --isolate-workspaces: workspace isolation without production mode. Each workspace
    package uses only the dependencies its own package.json lists, so one default run checks every package, its tests,
    scripts and tool configs included, against its own manifest, development dependencies included. [js] strict is the
    configuration counterpart of --strict (production mode, isolation and knip's direct-dependency rules), so CI no
    longer needs the flag. Setting the mode in the file gives every run, skif baseline write and prune included, the
    same mode, and stale-js-config judges ignore-dependencies entries against that one run. skif migrate --from knip
    writes knip's --strict to [js] strict = true when every script runs knip with it; when only some scripts do, a
    note leaves it to a human. knip 5's --isolate-workspaces, which only split the TypeScript programs, stays without
    effect (ADR 0005,
    #221).
  • [js.compilers], the static counterpart of knip's compilers: an extension skif has no reader for is read by regular
    expressions with one capture group (html = { imports = ['<script[^>]+src="([^"]+)"'] }), whose captures are imports
    resolved from the file, or with one of skif's readers (page = { as = "mdx" }). Such files join the default project,
    so unused-files judges them, and their imports count as usage and are reported by unresolved-imports and
    unlisted-dependencies like written ones. An invalid entry is a configuration error, and skif migrate --from knip
    points a compiler it cannot translate at the table (#209).
  • [js] use-public-hoisting (default false): a package that pnpm's public-hoist-pattern or shamefully-hoist
    (pnpm-workspace.yaml, else the root .npmrc before pnpm 11) or rules_js's public_hoist_packages hoists into a
    node_modules above a package is available to it, so importing it unlisted is no unlisted-dependencies finding.
    unused-dependencies and strict mode are unchanged. YamlSource of skif-workspace gains public_hoist_pattern and
    shamefully_hoist, and skif-js-plugins exports bazel::public_hoist_packages (ADR
    0123
    ,
    #178).
  • JS rules for knip's subpaths issue type: unused-subpath-imports (warning) reports a package.json imports
    entry that no # specifier of the package's files selects, with an unsafe fix that removes it;
    unused-subpath-exports (off by default, as knip's includeSubpathExports) reports an exports subpath that no
    workspace package imports by name, the package itself included, and has no fix. A pattern entry (#utils/*,
    ./features/*) is used when any import matches it, an exact entry wins over a pattern as in Node.js, and a subpath
    that publishes no module (./package.json, a stylesheet) is not reported. Production mode reports neither, because
    test files may be the only importers. --include subpaths and --fix-type subpaths select the imports rule, and
    skif migrate --from knip maps subpaths, includeSubpathExports and --include-subpath-exports
    (#208).
  • skif explain-usage --dependency <NAME> [--package <NAME|DIR>] explains why a dependency is used or unused in each
    package that lists it: the verdict unused-dependencies reaches and the importing files, mocks, commands, binaries,
    scripts, plugins and tool configs that credit it, or the imports that count for nothing; --format json prints the
    same report document as the file explanation. The verdict and the evidence come from one record of uses. A package
    that does not list the dependency has the verdict not listed, without a credit from the @types, peer or
    always-used rules, and the config files and lines that name a dependency the package does not list are listed
    (unlisted-references in the JSON) (#150).
  • Bazel plugin for rules_js repositories: the BUILD.bazel and BUILD files of a package are scanned as Starlark
    text. node_modules labels (":node_modules/esbuild", "//packages/app:node_modules/zod") and package_json.bzl
    loads ("@npm//packages/app:esbuild/package_json.bzl") use the dependency of the package they name, reported at the
    line of the label. A label of an enclosing package's node_modules ("//adev:node_modules/diff") in a BUILD file
    of a nested package counts only for the package it names, and a dependency so named that the labelled package does not
    list is unlisted at the BUILD file for that package. A comprehension that formats each string of a list literal
    ([":node_modules/%s" % name for name in ["typescript", "vite"]]) names the formatted packages; the patterns of a
    glob(...) ("node_modules/**"), any other format template and a node_modules target that is no valid npm package
    name name no dependency. The entry_point of js_binary, js_run_devserver and js_test is an entry with public
    exports. The srcs and data of js_library and ts_project, and the data of the other three, are build sources:
    the files are used and what they import is followed, but their exports are not public, so unused-exports,
    unused-types, the member rules and duplicate-exports judge them as any module's. A file that an entry rule also
    matches stays an entry, and a root BUILD file can name the sources of a member below it. Those of js_test are not
    used in production mode. skif-js-plugins gains PluginInput::BuildSource, ProductionBuildSource and
    ReaderDependency and PluginOutput::build_sources and production_build_sources; WorkspaceInputs gains
    build_source and production_build_source; UsageReport gains build_source and chain_from_build_source,
    serialized as build-source and `chain-f...
Read more

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 12 Nov 02:50

Release v0.3.0

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 08 Nov 21:55

Release v0.2.0

v0.1.1

Choose a tag to compare

@github-actions github-actions released this 07 Nov 08:52

Release v0.1.1

v0.1.0

Choose a tag to compare

@github-actions github-actions released this 06 Nov 18:33

Release v0.1.0