tsgolint-rust 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -6
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -51,6 +51,13 @@ ts-rust has the [Effect](https://effect.website) language service diagnostics bu
|
|
|
51
51
|
|
|
52
52
|
oxlint runs the `tsgolint` bin of the `oxlint-tsgolint` package. tsgolint-rust ships the same bin in the [`tsgolint-rust`](https://www.npmjs.com/package/tsgolint-rust) package, so you install it under the name `oxlint-tsgolint`. It picks its binary from one of `@tsgolint-rust/darwin-arm64`, `darwin-x64`, `linux-arm64`, `linux-x64` (static, for glibc and musl), `win32-arm64` and `win32-x64`.
|
|
53
53
|
|
|
54
|
+
```
|
|
55
|
+
npm install tsgolint-rust
|
|
56
|
+
|
|
57
|
+
# or nightly channel
|
|
58
|
+
npm install tsgolint-rust@nightly
|
|
59
|
+
```
|
|
60
|
+
|
|
54
61
|
oxlint declares an optional peer dependency on `oxlint-tsgolint@>=7.0.2003`. tsgolint-rust has its own versions, so tell your package manager to accept it, as below. Otherwise pnpm warns about an unmet peer and npm refuses to install.
|
|
55
62
|
|
|
56
63
|
With pnpm, alias it in `package.json`:
|
|
@@ -90,6 +97,8 @@ When another package brings `oxlint-tsgolint` in, override it everywhere instead
|
|
|
90
97
|
|
|
91
98
|
Where no native build runs, or native binaries are not allowed, use the wasm build on Node's WASI: `"oxlint-tsgolint": "npm:@tsgolint-rust/wasm32-wasip1@0.1.0"`. It gives the same output on one thread, on Linux and macOS.
|
|
92
99
|
|
|
100
|
+
Each push to `master` with unreleased changes publishes a nightly: `npm:tsgolint-rust@nightly`. Releases are on `latest`.
|
|
101
|
+
|
|
93
102
|
## Build from source
|
|
94
103
|
|
|
95
104
|
```sh
|
|
@@ -102,7 +111,7 @@ The wasm build, under [wasmtime](https://wasmtime.dev):
|
|
|
102
111
|
```sh
|
|
103
112
|
cargo build --release --target wasm32-wasip1 -p tsgolint-rust
|
|
104
113
|
TSGOLINT_WASM=$PWD/target/wasm32-wasip1/release/tsgolint.wasm \
|
|
105
|
-
OXLINT_TSGOLINT_PATH=$PWD/tsgolint-rust/e2e/tsgolint-wasm.sh \
|
|
114
|
+
OXLINT_TSGOLINT_PATH=$PWD/crates/tsgolint-rust/e2e/tsgolint-wasm.sh \
|
|
106
115
|
pnpm exec oxlint --type-aware --type-check
|
|
107
116
|
```
|
|
108
117
|
|
|
@@ -110,13 +119,24 @@ TSGOLINT_WASM=$PWD/target/wasm32-wasip1/release/tsgolint.wasm \
|
|
|
110
119
|
|
|
111
120
|
| Crate | What it has |
|
|
112
121
|
|---|---|
|
|
113
|
-
| [`tsgolint-core`](tsgolint-core) | Program loading on ts-rust, the rule framework, the AST walk and the lint engine |
|
|
114
|
-
| [`tsgolint-rules`](tsgolint-rules) | The 60 rules, their shared helpers, and the test harness with tsgolint's cases and snapshots |
|
|
115
|
-
| [`tsgolint-rust`](tsgolint-rust) | The `tsgolint` binary: command line, `headless` protocol, tsconfig discovery, driver |
|
|
116
|
-
| [`tsgolint-compare`](tsgolint-compare) | A dev tool that runs the Go and Rust binaries on one payload and compares them |
|
|
122
|
+
| [`tsgolint-core`](crates/tsgolint-core) | Program loading on ts-rust, the rule framework, the AST walk and the lint engine |
|
|
123
|
+
| [`tsgolint-rules`](crates/tsgolint-rules) | The 60 rules, their shared helpers, and the test harness with tsgolint's cases and snapshots |
|
|
124
|
+
| [`tsgolint-rust`](crates/tsgolint-rust) | The `tsgolint` binary: command line, `headless` protocol, tsconfig discovery, driver |
|
|
125
|
+
| [`tsgolint-compare`](crates/tsgolint-compare) | A dev tool that runs the Go and Rust binaries on one payload and compares them |
|
|
117
126
|
|
|
118
127
|
Each tsconfig becomes one ts-rust program. ts-rust gives every file a checker, and each checker lives on its own thread. The engine sends each checker one job with the TypeScript diagnostics of its files, then one job that runs the rules on them. The binary streams the results to oxlint through tsgolint's 400 KB output buffer while the run goes on. [ARCHITECTURE.md](ARCHITECTURE.md) has the details.
|
|
119
128
|
|
|
120
129
|
## Development
|
|
121
130
|
|
|
122
|
-
`pnpm exec turbo run check test build` runs fmt and clippy, the Rust tests
|
|
131
|
+
`pnpm exec turbo run check test e2e e2e:wasm build` runs fmt and clippy, the Rust tests, both e2e runs, and the release builds. CircleCI runs the same tasks on Linux, macOS and Windows, then the release builds of every target; [CONTRIBUTING.md](CONTRIBUTING.md#ci) lists the jobs. The toolchain is in `rust-toolchain.toml`. ts-rust comes from [pingdotgg/ts-rust](https://github.com/pingdotgg/ts-rust), branch `main`. `Cargo.lock` pins the commit, and [UPSTREAM.json](UPSTREAM.json) records it with the TypeScript commit it ports and the ported tsgolint release. Two daily CircleCI pipelines open pull requests that merge by themselves once their checks pass: the ts-rust bump moves ts-rust when its compiler sources change and regenerates the snapshots, and the tsgolint bump moves to a newer tsgolint release with its new cases, snapshots and e2e changes, leaving the rule changes to port on the pull request.
|
|
132
|
+
|
|
133
|
+
## Provenance
|
|
134
|
+
|
|
135
|
+
Each [GitHub release](https://github.com/tunnckoCoreHQ/tsgolint-rust/releases) has `provenance.sigstore.json`, a [Sigstore](https://www.sigstore.dev)-signed SLSA provenance of every npm tarball and binary of the release, from the CircleCI job that published it. npm shows no provenance for publishes from CircleCI. Verify a file with [cosign](https://github.com/sigstore/cosign):
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
cosign verify-blob-attestation --bundle provenance.sigstore.json --type https://slsa.dev/provenance/v1 \
|
|
139
|
+
--certificate-oidc-issuer https://oidc.circleci.com/org/34fb47d2-eada-4025-980d-7e9a7d912ca8 \
|
|
140
|
+
--certificate-identity-regexp '^https://circleci\.com/api/v2/projects/46741416-4ff4-48ad-8ee4-2e315fe8db18/' \
|
|
141
|
+
tsgolint-linux-x64
|
|
142
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tsgolint-rust",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "A Rust port of tsgolint on ts-rust: the type-aware linter that oxlint runs for --type-aware and --type-check. Install it as oxlint-tsgolint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"oxlint",
|
|
@@ -30,5 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"optionalDependencies": {
|
|
35
|
+
"@tsgolint-rust/darwin-arm64": "0.1.0",
|
|
36
|
+
"@tsgolint-rust/darwin-x64": "0.1.0",
|
|
37
|
+
"@tsgolint-rust/linux-arm64": "0.1.0",
|
|
38
|
+
"@tsgolint-rust/linux-x64": "0.1.0",
|
|
39
|
+
"@tsgolint-rust/win32-arm64": "0.1.0",
|
|
40
|
+
"@tsgolint-rust/win32-x64": "0.1.0"
|
|
33
41
|
}
|
|
34
42
|
}
|