@commonplaces/oxlint-plugin 0.6.0 → 0.6.2
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 +45 -17
- package/dist/alchemy.js +2 -1
- package/dist/conventions/contracts.js +1 -1
- package/dist/service-instrumentation.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @commonplaces/oxlint-plugin
|
|
2
2
|
|
|
3
3
|
107 custom Oxlint rules for strict Effect TypeScript, Alchemy and general code
|
|
4
|
-
checks. Version 0.6.
|
|
4
|
+
checks. Version 0.6.1 supports **Oxlint 1.87.0, 1.88.0 or 1.89.0** and **Node 22.14 or newer**.
|
|
5
5
|
Oxlint's JavaScript plugin API is experimental, so upgrade it only after running
|
|
6
6
|
the rule tests. The development tools use 1.89.0; consuming projects may use any supported version.
|
|
7
7
|
All three exact versions are checked with independently installed archives. ESLint is not a supported host.
|
|
@@ -12,13 +12,14 @@ Effect setup below after dependency installation.
|
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
15
|
-
Install version 0.6.
|
|
15
|
+
Install version 0.6.1 and save its exact version:
|
|
16
16
|
|
|
17
17
|
```sh
|
|
18
|
-
npm install --save-dev --save-exact @commonplaces/oxlint-plugin@0.6.
|
|
18
|
+
npm install --save-dev --save-exact @commonplaces/oxlint-plugin@0.6.1 \
|
|
19
|
+
@effect/tsgo@0.55.0 oxlint@1.89.0 oxlint-tsgolint@7.0.2004 typescript@7.0.2
|
|
19
20
|
```
|
|
20
21
|
|
|
21
|
-
Version 0.6.
|
|
22
|
+
Version 0.6.1 supports exactly Oxlint 1.87.0, 1.88.0 or 1.89.0. Older releases
|
|
22
23
|
keep their earlier host lists. Consumer adoption is a separate step.
|
|
23
24
|
|
|
24
25
|
The manifest and lockfile retain the resolved version. Historical GitHub release
|
|
@@ -73,21 +74,46 @@ unstable APIs. Type-aware checking is enabled by the group itself; consumers
|
|
|
73
74
|
do not need to import another preset. Upstream's unrelated style and maintainer
|
|
74
75
|
preferences are not added to the public group.
|
|
75
76
|
|
|
76
|
-
The package
|
|
77
|
-
regular dependencies.
|
|
78
|
-
|
|
77
|
+
The package ships `@effect/tsgo` **0.55.0** and `oxlint-tsgolint` **7.0.2004**
|
|
78
|
+
as exact regular dependencies. Full Effect projects should also declare their
|
|
79
|
+
compiler and checker tools directly, as in the install command above. This
|
|
80
|
+
keeps the selected local tools explicit. The pinned checker supports TypeScript
|
|
81
|
+
**7.0.2** or **7.1.0-dev.20261019.1**, alongside the three Oxlint versions above.
|
|
82
|
+
The archive tests use TypeScript 7.0.2.
|
|
83
|
+
Check the installed checker's supported versions before changing these tools.
|
|
79
84
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
85
|
+
Use [Effect's recommended automatic setup](https://github.com/Effect-TS/tsgo/blob/main/docs/README.md).
|
|
86
|
+
Add this command to the consuming project's root `package.json`:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"scripts": {
|
|
91
|
+
"prepare": "effect-tsgo patch --oxlint"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
83
94
|
```
|
|
84
95
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
96
|
+
Merge the patch command into an existing `prepare` script with `&&`; retain its
|
|
97
|
+
hooks, code generation and build tasks. Add it once at the repository root.
|
|
98
|
+
Run `npm install` after editing the script. Future installs, including clean
|
|
99
|
+
CI installs, run it automatically. Then run the project's normal strict
|
|
100
|
+
TypeScript and Oxlint commands, including `oxlint --deny-warnings .`.
|
|
101
|
+
|
|
102
|
+
This prepares both the TypeScript compiler and Oxlint. Do not use
|
|
103
|
+
`--no-typescript` for a full Effect project. That option is only for an explicit
|
|
104
|
+
Oxlint-only host which has no supported native TypeScript compiler; record that
|
|
105
|
+
host constraint rather than making it the shared default. Do not use
|
|
106
|
+
`--skip-missing` to hide missing tools or incompatible versions.
|
|
107
|
+
|
|
108
|
+
For initial configuration, the installed `effect-tsgo setup` command can guide
|
|
109
|
+
TypeScript, Oxlint and editor setup. Review its proposed changes against the
|
|
110
|
+
project's existing strict rules and exact dependency versions. Keep the shared
|
|
111
|
+
presets and all project-specific restrictions active.
|
|
112
|
+
|
|
113
|
+
If a deliberate install or lint-package refresh uses `--ignore-scripts`, run
|
|
114
|
+
`effect-tsgo patch --oxlint` explicitly after that operation and before checking
|
|
115
|
+
code. An earlier successful prepare does not cover replaced binaries. Missing
|
|
116
|
+
native setup causes a configuration error rather than silently losing checks.
|
|
91
117
|
|
|
92
118
|
Keep a normal `tsconfig.json` covering the checked files. Native diagnostic
|
|
93
119
|
options, such as exact unstable APIs approved for particular test files, live
|
|
@@ -294,7 +320,9 @@ accepted options; no marketplace plugin is needed to read or run them.
|
|
|
294
320
|
The portable Effect checks use the existing `strict-effect/` names, and the
|
|
295
321
|
Alchemy checks use `alchemy-secrets/`. Keep those names when moving from copied
|
|
296
322
|
rule files. Remove the copied implementations and change `jsPlugins` to the
|
|
297
|
-
package subpaths; keep your existing rule settings.
|
|
323
|
+
package subpaths; keep your existing rule settings. The native-source rule
|
|
324
|
+
recognises both `alchemy/Doppler` and the Alchemy beta.84 provider package
|
|
325
|
+
`@alchemy.run/doppler`.
|
|
298
326
|
|
|
299
327
|
## Immutable accumulation
|
|
300
328
|
|
package/dist/alchemy.js
CHANGED
|
@@ -22,7 +22,8 @@ const nativeSources = defineRule({
|
|
|
22
22
|
create(context) {
|
|
23
23
|
return {
|
|
24
24
|
ArrayExpression(node) {
|
|
25
|
-
const doppler = (element) => Option.isSome(providerCall(context, element, "alchemy/Doppler", "Secrets"))
|
|
25
|
+
const doppler = (element) => Option.isSome(providerCall(context, element, "alchemy/Doppler", "Secrets")) ||
|
|
26
|
+
Option.isSome(providerCall(context, element, "@alchemy.run/doppler", "Secrets"));
|
|
26
27
|
if (!Array.some(node.elements, (element) => element !== null && doppler(element)))
|
|
27
28
|
return;
|
|
28
29
|
const valid = node.elements.length === 3 &&
|
|
@@ -65,7 +65,7 @@ export const contractRules = {
|
|
|
65
65
|
"no-host-api-in-contract": rule("Keep service, Schema, error and config contracts portable; acquire host APIs in private adapters.", (context) => ({
|
|
66
66
|
ImportDeclaration(node) {
|
|
67
67
|
if (/(?:^|\/)(?:services?|schemas?|errors|config)\.ts$/u.test(context.filename) &&
|
|
68
|
-
/^(?:node:|bun$|playwright$|lighthouse$|chrome-launcher$|alchemy(?:\/|$)|@cloudflare(?:\/|$)|cloudflare$|@octokit(?:\/|$)|@actions(?:\/|$)|@sentry(?:\/|$)|stripe$|resend$|@aws(?:\/|$)|aws-sdk$)/u.test(node.source.value))
|
|
68
|
+
/^(?:node:|bun$|playwright$|lighthouse$|chrome-launcher$|alchemy(?:\/|$)|@alchemy\.run\/|@cloudflare(?:\/|$)|cloudflare$|@octokit(?:\/|$)|@actions(?:\/|$)|@sentry(?:\/|$)|stripe$|resend$|@aws(?:\/|$)|aws-sdk$)/u.test(node.source.value))
|
|
69
69
|
report(context, node.source);
|
|
70
70
|
},
|
|
71
71
|
})),
|
|
@@ -42,7 +42,7 @@ const serviceOf = (context, node, visited = []) => {
|
|
|
42
42
|
if (Array.some(visited, (previous) => previous === node))
|
|
43
43
|
return Option.none();
|
|
44
44
|
const next = [...visited, node];
|
|
45
|
-
const imported = referenceOf(context, node).pipe(Option.filter((reference) => !/^(?:effect|alchemy)(?:\/|$)/u.test(reference.module)), Option.flatMap((reference) => reference.name), Option.filter((name) => /^[A-Z]/u.test(name)), Option.map((name) => ({ name, declaration: Option.none() })));
|
|
45
|
+
const imported = referenceOf(context, node).pipe(Option.filter((reference) => !/^(?:(?:effect|alchemy)(?:\/|$)|@alchemy\.run\/)/u.test(reference.module)), Option.flatMap((reference) => reference.name), Option.filter((name) => /^[A-Z]/u.test(name)), Option.map((name) => ({ name, declaration: Option.none() })));
|
|
46
46
|
if (Option.isSome(imported))
|
|
47
47
|
return imported;
|
|
48
48
|
if (node.type !== "Identifier")
|