@stll/oxlint-config 0.10.0 → 0.11.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 +146 -0
- package/dist/toolchain-check-cli.cjs +2244 -147
- package/dist/toolchain-check-cli.cjs.map +1 -1
- package/dist/toolchain-check-cli.mjs +2244 -148
- package/dist/toolchain-check-cli.mjs.map +1 -1
- package/dist/typecheck-parity-cli.cjs +77 -16
- package/dist/typecheck-parity-cli.cjs.map +1 -1
- package/dist/typecheck-parity-cli.mjs +77 -16
- package/dist/typecheck-parity-cli.mjs.map +1 -1
- package/package.json +10 -1
- package/toolchain.json +75 -2
package/README.md
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# @stll/oxlint-config
|
|
2
|
+
|
|
3
|
+
Shared oxlint presets, JavaScript plugins, and toolchain policy for Stella
|
|
4
|
+
packages. Repository-specific rules and exceptions belong in the consuming
|
|
5
|
+
repository's configuration.
|
|
6
|
+
|
|
7
|
+
## Install and configure
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
bun add -d @stll/oxlint-config
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Install `oxlint`, `oxlint-tsgolint`, and any other shared tools at the exact
|
|
14
|
+
versions in the exported `@stll/oxlint-config/toolchain.json`. That file is the
|
|
15
|
+
source for current pins; peer dependency ranges describe supported versions.
|
|
16
|
+
|
|
17
|
+
Use the library preset in `oxlint.config.ts`:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { library } from "@stll/oxlint-config";
|
|
21
|
+
|
|
22
|
+
export default library({
|
|
23
|
+
ignorePatterns: ["dist/"],
|
|
24
|
+
overrides: [
|
|
25
|
+
{
|
|
26
|
+
files: ["scripts/**"],
|
|
27
|
+
rules: { "no-console": "off" },
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The preset includes the shared `stella-lowercase` and `no-raw-colors`
|
|
34
|
+
JavaScript plugins. The separate `@stll/oxlint-plugin` package provides
|
|
35
|
+
portable safety and route-query rules. See the
|
|
36
|
+
[repository usage guide](https://github.com/stella/tooling#usage) for other
|
|
37
|
+
presets, CommonJS configuration, and plugin composition.
|
|
38
|
+
|
|
39
|
+
## Shared toolchain and Bun
|
|
40
|
+
|
|
41
|
+
`@stll/oxlint-config/toolchain.json` is a versioned policy for package pins,
|
|
42
|
+
Bun, TypeScript install layouts, Node, Python, Rust, GitHub Actions, and
|
|
43
|
+
Dependabot. Inherit the fields for tools your repository uses. The checker
|
|
44
|
+
does not require tools absent from the repository.
|
|
45
|
+
|
|
46
|
+
Set `packageManager` to `bun@` followed by the policy's `bun` value, and pin
|
|
47
|
+
`bun-types` to that same value. Dependency pins can live in default or named
|
|
48
|
+
catalogs, including Bun's `workspaces` catalogs. Bun image tags, version
|
|
49
|
+
files, and mise/asdf entries also inherit the policy pin.
|
|
50
|
+
|
|
51
|
+
Configure `oven-sh/setup-bun` with a tracked manifest as its version source:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
with:
|
|
55
|
+
bun-version-file: package.json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The action itself must use the policy's approved SHA and version comment.
|
|
59
|
+
A prefixed version-file selector can use a preceding checkout in its job:
|
|
60
|
+
use the exact `${{ job.workflow_repository }}` / `${{ job.workflow_sha }}` pair,
|
|
61
|
+
or a same-repository checkout with no `ref`. For no-ref checkouts, omit
|
|
62
|
+
`repository`, name this repository literally, or use `${{ github.repository }}`.
|
|
63
|
+
The checkout must omit both `if` and `continue-on-error`, and its normalized
|
|
64
|
+
path must be unique among every checkout in that job, including later steps.
|
|
65
|
+
Unknown checkout destinations prevent mapped selectors from proving provenance.
|
|
66
|
+
Sparse checkouts must explicitly list the selected repository-relative file,
|
|
67
|
+
without the checkout prefix, in `sparse-checkout`. This applies in either cone
|
|
68
|
+
mode and to delegated sources. Dynamic, empty, glob, negation, or unsupported
|
|
69
|
+
sparse configurations fail; a cone-mode input alone is insufficient. Directory
|
|
70
|
+
entries cannot substitute for the selected file.
|
|
71
|
+
Other nonempty, nonconstant GitHub expression refs on same-repository checkouts
|
|
72
|
+
(including `${{ job.workflow_repository }}`) delegate a safe static version-file selector
|
|
73
|
+
to that checkout. The CLI reports delegation on stdout without validating the
|
|
74
|
+
current source's version file. Literal refs and unpaired `${{ github.sha }}` /
|
|
75
|
+
`${{ job.workflow_sha }}` remain rejected.
|
|
76
|
+
For snapshot-bound sources, the guard maps the selector to its tracked source
|
|
77
|
+
file. Literal commit SHAs,
|
|
78
|
+
branches, tags, unpaired snapshot contexts, foreign repositories, and traversal
|
|
79
|
+
paths fail.
|
|
80
|
+
Direct `bun-version` inputs are forbidden. For snapshot-bound sources, the
|
|
81
|
+
manifest referenced by `bun-version-file` must declare the shared
|
|
82
|
+
`packageManager` value. Delegated commits own their version validation.
|
|
83
|
+
|
|
84
|
+
The Node policy is `26.x`. Runtime selectors (`.node-version`, `.nvmrc`,
|
|
85
|
+
setup-node's `node-version-file`, Node image tags and mise/asdf entries)
|
|
86
|
+
must select major 26: bare major, major wildcard, minor and stable patch
|
|
87
|
+
selectors within that major are allowed. Open ranges, floating aliases,
|
|
88
|
+
other majors and prereleases fail. Use `node-version-file` for setup-node.
|
|
89
|
+
`engines.node` remains a support range and must include every stable release
|
|
90
|
+
in major 26; `>=26`, `^26` and `^24 || ^26` pass, while ranges that omit
|
|
91
|
+
part of major 26 fail.
|
|
92
|
+
Release and publish workflows use exact patch version-file selectors for
|
|
93
|
+
reproducible builds; this repository pins `.node-version` to `26.10.0`.
|
|
94
|
+
The series policy accepts that patch without weakening release validation.
|
|
95
|
+
GitHub JavaScript action host runtimes (`runs.using`) are platform-managed
|
|
96
|
+
and do not select the project toolchain Node version.
|
|
97
|
+
|
|
98
|
+
Run the installed checker from the repository root in CI:
|
|
99
|
+
|
|
100
|
+
```sh
|
|
101
|
+
bunx --no-install stll-toolchain-check
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The CLI checks tracked files, prints `path:line: [rule] message` diagnostics,
|
|
105
|
+
and exits with status 1 on a mismatch. Updating the package updates the
|
|
106
|
+
policy; update consumer pins and run the checker together.
|
|
107
|
+
|
|
108
|
+
`typescriptInstallLayouts` declares the compiler package, exact specifier,
|
|
109
|
+
and typecheck command for each supported layout. Prefer the direct layout.
|
|
110
|
+
Use the split compatibility layout for the compiler-API consumers and peer
|
|
111
|
+
blockers listed in `typescript6Compatibility`; it retains the current
|
|
112
|
+
compiler for typechecking while providing the compatibility package.
|
|
113
|
+
|
|
114
|
+
An exception requires a tracked root `stll-toolchain.json` with the named
|
|
115
|
+
rule and a nonempty reason:
|
|
116
|
+
|
|
117
|
+
```json
|
|
118
|
+
{
|
|
119
|
+
"optOuts": [{ "rule": "bun-pins", "reason": "This repository uses npm." }]
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`node-engine` is mandatory: an opt-out cannot bypass the shared Node support range.
|
|
124
|
+
|
|
125
|
+
Opt-outs apply to the entire repository for that rule. Unknown or duplicate
|
|
126
|
+
rules, empty reasons, and malformed configuration fail validation. See the
|
|
127
|
+
[shared toolchain reference](https://github.com/stella/tooling#shared-toolchain)
|
|
128
|
+
for the schema, rule list, runtime support ranges, and generated Dependabot
|
|
129
|
+
template.
|
|
130
|
+
|
|
131
|
+
## Typecheck parity project selection
|
|
132
|
+
|
|
133
|
+
Run `stll-typecheck-parity` from the repository root. Without flags, it checks
|
|
134
|
+
the root `tsconfig.json` and recursively discovers project references in build
|
|
135
|
+
mode. Repeat `--project` to check exactly the selected configs:
|
|
136
|
+
|
|
137
|
+
```sh
|
|
138
|
+
stll-typecheck-parity --project packages/api/tsconfig.json --project packages/web/tsconfig.json
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Selected configs run independently using the repository-root compiler
|
|
142
|
+
installation; child packages need no compiler declaration and a root tsconfig
|
|
143
|
+
is unnecessary. Their original reference metadata is preserved without
|
|
144
|
+
discovering or building referenced projects. Missing, unreadable, and zero-input
|
|
145
|
+
selected configs fail the check. `--help` prints usage and exits successfully;
|
|
146
|
+
unknown arguments fail.
|