@butshouldwe/oxlint-config 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +103 -2
- package/index.d.ts +4 -0
- package/index.js +15 -0
- package/package.json +51 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Steve Dalonzo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,104 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @butshouldwe/oxlint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Shared strict oxlint layer: Effect correctness,
|
|
4
|
+
antipattern and effectNative presets, then Ultracite anti-slop 8.0.1.
|
|
5
|
+
The spacing rule stays off because oxfmt owns layout.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
Install from npm with the pinned peer toolchain:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
pnpm add -D @butshouldwe/oxlint-config @effect/tsgo@0.53.4 \
|
|
13
|
+
oxlint@1.88.0 oxlint-tsgolint@7.0.2004 ultracite@8.0.1
|
|
14
|
+
pnpm exec effect-tsgo patch --oxlint
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Keep `effect-tsgo patch --oxlint` in the consumer's prepare script.
|
|
18
|
+
The Effect rules need those patched binaries. This package does not patch
|
|
19
|
+
the consumer through an install hook. Commit the updated lockfile, then
|
|
20
|
+
verify installation with `pnpm install --frozen-lockfile`.
|
|
21
|
+
|
|
22
|
+
## Required consumer config
|
|
23
|
+
|
|
24
|
+
Use this object import in `oxlint.config.ts`, not a file path in `extends`:
|
|
25
|
+
|
|
26
|
+
```ts
|
|
27
|
+
import shared from "@butshouldwe/oxlint-config";
|
|
28
|
+
import { defineConfig } from "oxlint";
|
|
29
|
+
|
|
30
|
+
export default defineConfig({
|
|
31
|
+
extends: [shared],
|
|
32
|
+
plugins: [],
|
|
33
|
+
categories: {
|
|
34
|
+
correctness: "error",
|
|
35
|
+
suspicious: "error",
|
|
36
|
+
perf: "error",
|
|
37
|
+
style: "off",
|
|
38
|
+
},
|
|
39
|
+
options: {
|
|
40
|
+
typeAware: true,
|
|
41
|
+
typeCheck: true,
|
|
42
|
+
},
|
|
43
|
+
ignorePatterns: [
|
|
44
|
+
"**/dist",
|
|
45
|
+
"**/node_modules",
|
|
46
|
+
"**/.agents/**",
|
|
47
|
+
"**/.claude/**",
|
|
48
|
+
"**/.agents/skills",
|
|
49
|
+
"**/.claude/skills",
|
|
50
|
+
],
|
|
51
|
+
});
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Categories and options are required at the root, not hidden in `extends`.
|
|
55
|
+
Ignores belong to each consumer.
|
|
56
|
+
`plugins: []` prevents oxlint from adding root defaults back during inheritance.
|
|
57
|
+
Effect rules keep their existing warning severities. Other enabled categories
|
|
58
|
+
use errors. This package does not add Ultracite core, Vitest or style presets.
|
|
59
|
+
|
|
60
|
+
## Module mocking ban
|
|
61
|
+
|
|
62
|
+
The preset bans `vi.mock` and `vi.doMock`.
|
|
63
|
+
Fake the boundary through its real interface instead. The preset pins
|
|
64
|
+
Ultracite's `anti-slop/no-module-mocking` rule at error. It reports:
|
|
65
|
+
|
|
66
|
+
- `vi.mock`, `vi.doMock` and `vi.unstable_mockModule`, also as `vi?.mock`,
|
|
67
|
+
`vi.mock?.()` and `vi["mock"]`;
|
|
68
|
+
- an aliased import such as `import { vi as v } from "vitest"`;
|
|
69
|
+
- `jest.mock` from the global or `@jest/globals`.
|
|
70
|
+
|
|
71
|
+
It does not report `vi.fn`, `vi.spyOn`, `vi.useFakeTimers` or a local `mock`
|
|
72
|
+
method. It also cannot see a destructured `const { mock } = vi`, a rebound
|
|
73
|
+
`const v = vi`, a template-literal key, `globalThis.vi.mock` or `vi.importMock`.
|
|
74
|
+
The diagnostic text is Ultracite's and names the alternative: dependency
|
|
75
|
+
injection through a real interface. `tests/module-mocking.test.mjs` proves
|
|
76
|
+
the rule fires on `.ts` and `.tsx` test files through the real CLI.
|
|
77
|
+
|
|
78
|
+
## Verify
|
|
79
|
+
|
|
80
|
+
```sh
|
|
81
|
+
pnpm install --frozen-lockfile
|
|
82
|
+
pnpm test
|
|
83
|
+
pnpm typecheck
|
|
84
|
+
pnpm lint
|
|
85
|
+
pnpm format:check
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Tests run this README's config against the original source fixture.
|
|
89
|
+
They compare the complete
|
|
90
|
+
`oxlint --print-config` output, including all 230 resolved rules and severities.
|
|
91
|
+
Oxlint 1.88 omits `jsPlugins` from that output. Separate checks preserve the
|
|
92
|
+
plugin-bearing layers and compare real lint diagnostics, including a seeded
|
|
93
|
+
anti-slop error and a TypeScript compiler error.
|
|
94
|
+
|
|
95
|
+
The package test runs a real `npm pack` and checks the file allowlist,
|
|
96
|
+
MIT metadata, internal references and secrets. It requires Python 3.11+
|
|
97
|
+
and gitleaks 8.21.2. Run `bash scripts/install-check-tools.sh` to install
|
|
98
|
+
the pinned scanner into `.tools/`, then add `.tools` to your PATH.
|
|
99
|
+
Run `pnpm publish:check` for publint and the TypeScript resolution check.
|
|
100
|
+
CI verifies but never publishes. Never overwrite a published version.
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT. See [LICENSE](LICENSE).
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { antipattern, correctness, effectNative } from "@effect/tsgo/oxlint-presets";
|
|
2
|
+
import { defineConfig } from "oxlint";
|
|
3
|
+
import antiSlop from "ultracite/oxlint/anti-slop";
|
|
4
|
+
|
|
5
|
+
// Categories, root-only options and ignores stay in the consumer config.
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
extends: [correctness, antipattern, effectNative, antiSlop],
|
|
8
|
+
rules: {
|
|
9
|
+
"anti-slop/require-readable-spacing": "off",
|
|
10
|
+
// Fleet test policy (bsw-vitest 1.1.0): no vi.mock or vi.doMock; fake the
|
|
11
|
+
// boundary through its real interface. Pinned so an Ultracite bump cannot
|
|
12
|
+
// drop the ban without failing tests/module-mocking.test.mjs.
|
|
13
|
+
"anti-slop/no-module-mocking": "error",
|
|
14
|
+
},
|
|
15
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@butshouldwe/oxlint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Shared strict oxlint config: Effect presets and Ultracite anti-slop",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/butshouldwe/oxlint-config.git"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"index.js",
|
|
12
|
+
"index.d.ts",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"type": "module",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./index.d.ts",
|
|
20
|
+
"default": "./index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
},
|
|
27
|
+
"devDependencies": {
|
|
28
|
+
"@arethetypeswrong/cli": "0.18.5",
|
|
29
|
+
"@effect/tsgo": "0.53.4",
|
|
30
|
+
"oxfmt": "0.63.0",
|
|
31
|
+
"oxlint": "1.88.0",
|
|
32
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
33
|
+
"publint": "0.3.22",
|
|
34
|
+
"typescript": "7.0.2",
|
|
35
|
+
"ultracite": "8.0.1"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"@effect/tsgo": "0.53.4",
|
|
39
|
+
"oxlint": "1.88.0",
|
|
40
|
+
"oxlint-tsgolint": "7.0.2004",
|
|
41
|
+
"ultracite": "8.0.1"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=26"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"publish:check": "node scripts/publish-check.mjs",
|
|
48
|
+
"test": "node --test tests/*.test.mjs",
|
|
49
|
+
"format": "oxfmt",
|
|
50
|
+
"format:check": "oxfmt --check",
|
|
51
|
+
"typecheck": "tsc --noEmit --strict --skipLibCheck --module nodenext --target esnext tests/consumer.ts",
|
|
52
|
+
"lint": "node --check index.js && node --check tests/inheritance.test.mjs && node --check tests/module-mocking.test.mjs && node --check tests/pack.test.mjs && node --check scripts/publish-check.mjs"
|
|
53
|
+
}
|
|
6
54
|
}
|