
Security News
Software Engineering Daily Podcast: Feross on AI, Open Source, and Supply Chain Risk
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.
tsc-absolute
Advanced tools
👇 TypeScript compiler (tsc), but errors have absolute paths.
Inspired by this 2016 TypeScript issue, and a similar one opened in 2020. Given it seems to be a feature many people want, but the TypeScript team seem to be avoiding, this acts as a simple wrapper that implements this feature.
This is particularly useful for navigating to errors in monorepo setups, or for automating error detection and location from logs.
npm install --save-dev typescript tsc-absolute
Just use it as a drop-in replacement for tsc wherever you use it. All arguments are passed right through. For example:
"scripts": {
- "build": "tsc --strict"
+ "build": "tsc-absolute --strict"
}
This turns your logs from relative paths:
src/some/path/code.ts(20,9): error TS2322: Type 'number' is not assignable to type 'string'.
to absolute ones:
/home/domdomegg/my-workspace/my-package/src/some/path/code.ts(20,9): error TS2322: Type 'number' is not assignable to type 'string'.
It supports any version of TypeScript released in the last 12 months, mirroring the TypeScript team's security support window. This is validated with intregration tests that run in CI.
The library accepts TypeScript as a peer dependency, so just install TypeScript like normal to your preferred version and tsc-absolute will use that one.
It may work with older versions, but this is not explicitly supported. You should probably update anyways to ensure you continue to recieve security updates.
With this configuration, you can set up a GitHub problem matcher, for example in .github/matchers/tsc-absolute.json:
{
"problemMatcher": [
{
"owner": "tsc-absolute",
"pattern": [
{
"regexp": "(?:^|\\s)([^\\s][^:]*)[\\(:](\\d+)[,:](\\d+)(?:\\):\\s+|\\s+-\\s+)(error|warning|info)\\s+(TS\\d+)\\s*:\\s*(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"code": 5,
"message": 6
}
]
}
]
}
And in your workflow.yaml, add a step:
- name: Configure TSC problem matcher
run: |
echo "::remove-matcher owner=tsc::"
echo "::add-matcher::.github/matchers/tsc-absolute.json"
As an example, when you're done you can get output like this on your commits and PRs: https://github.com/domdomegg/tsc-absolute-github-actions-example/commit/cf254dc82fac7099070fbaa3cd78f83989c70d5a#diff-a2a171449d862fe29692ce031981047d7ab755ae7f84c707aef80701b3ea0c80
This is a best-efforts approach at correcting the error output and is usually very accurate. However, as the TypeScript compiler does not provide structured logging nor is it part of their public interface, it may break if TypeScript's logging format changes.
Additionally, the way the logs are (un)structured the regex can make mistakes if you have extremely odd filenames. The filenames have to be to the point that you'd probably have to be trying to break this, i.e. ones that have both spaces and brackets with numbers at just the wrong places in them - but if you're accepting any kind of input it's one to be aware of.
Pull requests are welcomed on GitHub! To get started:
npm installnpm run test to run testsnpm run buildVersions follow the semantic versioning spec.
To release:
npm version <major | minor | patch> to bump the versiongit push --follow-tags to push with tagsFAQs
TypeScript compiler (tsc), but errors have absolute paths
We found that tsc-absolute demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.

Security News
Rust’s crates.io team is advancing an RFC to add a Security tab that surfaces RustSec vulnerability and unsoundness advisories directly on crate pages.