@wellmade/oxlint-config 0.2.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/.oxlintrc.json ADDED
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3
+ "plugins": [
4
+ "typescript",
5
+ "unicorn",
6
+ "import",
7
+ "promise",
8
+ "node"
9
+ ],
10
+ "categories": {
11
+ "correctness": "error",
12
+ "suspicious": "error",
13
+ "perf": "warn",
14
+ "restriction": "off",
15
+ "pedantic": "off",
16
+ "style": "off",
17
+ "nursery": "off"
18
+ },
19
+ "env": {
20
+ "es2024": true,
21
+ "browser": true,
22
+ "node": true
23
+ },
24
+ "rules": {
25
+ "eqeqeq": [
26
+ "error",
27
+ "always"
28
+ ],
29
+ "no-debugger": "error",
30
+ "no-alert": "error",
31
+ "no-var": "error",
32
+ "prefer-const": "error",
33
+ "no-unused-vars": [
34
+ "error",
35
+ {
36
+ "argsIgnorePattern": "^_",
37
+ "varsIgnorePattern": "^_"
38
+ }
39
+ ],
40
+ "no-console": [
41
+ "error",
42
+ {
43
+ "allow": [
44
+ "debug",
45
+ "info",
46
+ "warn",
47
+ "error"
48
+ ]
49
+ }
50
+ ],
51
+ "no-await-in-loop": "off",
52
+ "import/no-duplicates": "error",
53
+ "import/no-self-import": "error",
54
+ "import/no-cycle": "error",
55
+ "promise/no-return-wrap": "error",
56
+ "promise/always-return": "off",
57
+ "typescript/no-explicit-any": "warn",
58
+ "typescript/no-non-null-assertion": "off",
59
+ "unicorn/no-array-for-each": "off",
60
+ "unicorn/no-null": "off",
61
+ "unicorn/no-array-sort": "off",
62
+ "unicorn/consistent-function-scoping": "off"
63
+ },
64
+ "ignorePatterns": [
65
+ "**/node_modules/**",
66
+ "**/dist/**",
67
+ "**/build/**",
68
+ "**/out/**",
69
+ "**/.next/**",
70
+ "**/.astro/**",
71
+ "**/.turbo/**",
72
+ "**/coverage/**",
73
+ "**/*.generated.*",
74
+ "**/*.generated"
75
+ ]
76
+ }
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Wellmade
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 ADDED
@@ -0,0 +1,82 @@
1
+ # @wellmade/oxlint-config
2
+
3
+ Shared [oxlint](https://oxc.rs/) config — the Rust-based linter that's ~50–100× faster than ESLint.
4
+
5
+ Same bug-prevention philosophy as `@wellmade/eslint-config`, expressed in oxlint's rule set. Wellmade dogfoods this on its own internal projects (atelier-ai, cli scaffolds, devcontainers). Customer projects can pick either side based on their existing tooling.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ npm install --save-dev oxlint @wellmade/oxlint-config
11
+ ```
12
+
13
+ Two consumer shapes work. **Use the JSON path** unless you have a specific reason not to — it's oxlint's stable, no-asterisk config format.
14
+
15
+ ### Recommended: `.oxlintrc.json`
16
+
17
+ ```json
18
+ {
19
+ "extends": ["./node_modules/@wellmade/oxlint-config/.oxlintrc.json"]
20
+ }
21
+ ```
22
+
23
+ Bare-specifier `extends` (`"@wellmade/oxlint-config"`) isn't supported yet ([oxc#15538](https://github.com/oxc-project/oxc/issues/15538)); the `node_modules` path is the workaround until that lands.
24
+
25
+ ### Alternative: `oxlint.config.ts` (experimental)
26
+
27
+ oxlint marks JS/TS config files as "experimental and requiring Node.js at runtime" (per `oxlint --help` in 1.67). They work and they let you compose programmatically, but the JSON path is more durable for now.
28
+
29
+ ```ts
30
+ // oxlint.config.ts
31
+ import wellmade from '@wellmade/oxlint-config';
32
+ export default wellmade;
33
+ ```
34
+
35
+ ### Run
36
+
37
+ ```sh
38
+ npx oxlint
39
+ ```
40
+
41
+ ### Opt-in: type-aware linting
42
+
43
+ oxlint can run typescript-eslint's type-aware rules natively (`options.typeAware`), which is a large speed win over `typescript-eslint`. It's **opt-in** because it has two hard requirements the base config won't force on everyone:
44
+
45
+ 1. install `oxlint-tsgolint` (the type-aware engine), and
46
+ 2. TypeScript **7.0+** (it runs on typescript-go).
47
+
48
+ ```sh
49
+ npm install --save-dev oxlint-tsgolint
50
+ ```
51
+
52
+ ```ts
53
+ // oxlint.config.ts
54
+ import { withTypeAware } from '@wellmade/oxlint-config';
55
+ export default withTypeAware();
56
+ ```
57
+
58
+ Without `oxlint-tsgolint` installed, oxlint fails with *"Failed to find tsgolint executable"* — that's the guard, not a bug. The base config stays type-aware-free so the default path needs no extra dependency.
59
+
60
+ The `correctness`/`suspicious` categories surface the type-aware `typescript/*` rules; `withTypeAware()` keeps the high-signal ones and switches off **`typescript/no-unsafe-type-assertion`** — it fires on every `as` cast, but validate-then-assert is a deliberate, correct pattern (typescript-eslint leaves this rule out of `recommended` for the same reason). Tuned against bedrock-js on TS 7: the rule accounted for 34 of 45 first-run findings, all safe-pattern false positives.
61
+
62
+ ## What's in it
63
+
64
+ - **`correctness` + `suspicious` → error.** These are oxlint's "this is almost certainly a bug" categories. They should never warn — they should fail CI.
65
+ - **`perf` → warn.** Useful signals, but not always actionable.
66
+ - **`style` / `pedantic` / `restriction` → off.** Style is Prettier/oxfmt's job. Pedantic and restriction are too opinionated for a shared config.
67
+ - **Plugins enabled:** `typescript`, `unicorn`, `import`, `promise`, `node`.
68
+ - **Explicit rule choices:** `eqeqeq: always`, `no-var`, `prefer-const`, `no-console: warn`, `no-debugger: error`, `import/no-cycle: error`.
69
+
70
+ ## Philosophy
71
+
72
+ Wellmade ships both `@wellmade/eslint-config` and `@wellmade/oxlint-config` deliberately. ESLint has wider plugin coverage; oxlint has the speed. The two configs converge on the same intent — catch real defects, leave formatting to formatters, stay quiet on debatable preferences — so consumers can pick by stack, not by philosophy.
73
+
74
+ ## What's intentionally *not* in it
75
+
76
+ - **No formatting rules.** Run `oxfmt` (or Prettier) for whitespace and layout.
77
+ - **No `bedrockPreset` yet.** The `JSON.parse` → `parseJson` redirects from `@wellmade/eslint-config` will land here once we've ported them; oxlint's JS plugin API shipped in late 2025 and is stabilizing.
78
+ - **No framework variants yet** (React, Node-specific, NestJS). These will arrive as sibling sub-exports as the dogfooding signal comes in.
79
+
80
+ ## Status
81
+
82
+ `0.x`. Wellmade is using this on its own work to gather real signal before recommending it to customer projects. Expect rule additions but no breaking removals without a minor bump and a `MIGRATION.md` note.
package/package.json ADDED
@@ -0,0 +1,52 @@
1
+ {
2
+ "name": "@wellmade/oxlint-config",
3
+ "version": "0.2.0",
4
+ "description": "Wellmade's shared oxlint config — same philosophy as @wellmade/eslint-config, in Oxc's Rust-based linter.",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "Wellmade",
8
+ "url": "https://www.wellmade.be"
9
+ },
10
+ "homepage": "https://github.com/wellmade-studio/standards-js/tree/main/packages/oxlint-config",
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/wellmade-studio/standards-js.git",
14
+ "directory": "packages/oxlint-config"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/wellmade-studio/standards-js/issues"
18
+ },
19
+ "type": "module",
20
+ "exports": {
21
+ ".": "./src/index.js",
22
+ "./.oxlintrc.json": "./.oxlintrc.json"
23
+ },
24
+ "main": "./src/index.js",
25
+ "files": [
26
+ "src/",
27
+ ".oxlintrc.json",
28
+ "LICENSE",
29
+ "README.md"
30
+ ],
31
+ "scripts": {
32
+ "build": "node ./scripts/build-json.js",
33
+ "lint": "echo 'no-op'",
34
+ "format": "echo 'no-op'",
35
+ "test": "node --test ./test.js"
36
+ },
37
+ "peerDependencies": {
38
+ "oxlint": ">=1.0.0 <2"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "keywords": [
44
+ "oxlint",
45
+ "oxc",
46
+ "oxlint-config",
47
+ "linter",
48
+ "rust",
49
+ "typescript",
50
+ "wellmade"
51
+ ]
52
+ }
package/src/index.js ADDED
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Wellmade's shared oxlint config, as a JS object.
3
+ *
4
+ * Consumers normally point at the JSON sibling via oxlint's `extends`:
5
+ *
6
+ * // .oxlintrc.json in your project root
7
+ * {
8
+ * "extends": ["./node_modules/@wellmade/oxlint-config/.oxlintrc.json"]
9
+ * }
10
+ *
11
+ * This JS export exists for programmatic composition and for our own tests.
12
+ * The shipped `.oxlintrc.json` is generated from it via `npm run build`.
13
+ *
14
+ * Rule choices mirror the bug-prevention bias of `@wellmade/eslint-config`:
15
+ * catch real defects, leave style to Prettier/oxfmt, stay quiet on debatable
16
+ * preferences. As oxlint's plugin coverage grows, more of the eslint-config
17
+ * intent will be expressible here.
18
+ *
19
+ * @see https://oxc.rs/docs/guide/usage/linter
20
+ */
21
+ export const baseConfig = {
22
+ $schema: 'https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json',
23
+
24
+ plugins: ['typescript', 'unicorn', 'import', 'promise', 'node'],
25
+
26
+ categories: {
27
+ correctness: 'error',
28
+ suspicious: 'error',
29
+ perf: 'warn',
30
+ restriction: 'off',
31
+ pedantic: 'off',
32
+ style: 'off',
33
+ nursery: 'off',
34
+ },
35
+
36
+ env: {
37
+ es2024: true,
38
+ browser: true,
39
+ node: true,
40
+ },
41
+
42
+ rules: {
43
+ eqeqeq: ['error', 'always'],
44
+ 'no-debugger': 'error',
45
+ 'no-alert': 'error',
46
+ 'no-var': 'error',
47
+ 'prefer-const': 'error',
48
+ 'no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
49
+
50
+ 'no-console': ['error', { allow: ['debug', 'info', 'warn', 'error'] }],
51
+
52
+ 'no-await-in-loop': 'off',
53
+
54
+ 'import/no-duplicates': 'error',
55
+ 'import/no-self-import': 'error',
56
+ 'import/no-cycle': 'error',
57
+
58
+ 'promise/no-return-wrap': 'error',
59
+ 'promise/always-return': 'off',
60
+
61
+ 'typescript/no-explicit-any': 'warn',
62
+ 'typescript/no-non-null-assertion': 'off',
63
+
64
+ 'unicorn/no-array-for-each': 'off',
65
+ 'unicorn/no-null': 'off',
66
+ 'unicorn/no-array-sort': 'off',
67
+ 'unicorn/consistent-function-scoping': 'off',
68
+ },
69
+
70
+ ignorePatterns: [
71
+ '**/node_modules/**',
72
+ '**/dist/**',
73
+ '**/build/**',
74
+ '**/out/**',
75
+ '**/.next/**',
76
+ '**/.astro/**',
77
+ '**/.turbo/**',
78
+ '**/coverage/**',
79
+ '**/*.generated.*',
80
+ '**/*.generated',
81
+ ],
82
+ };
83
+
84
+ export default baseConfig;
85
+
86
+ /**
87
+ * Opt-in type-aware layer.
88
+ *
89
+ * oxlint can now run typescript-eslint's type-aware rules natively via
90
+ * `options.typeAware` (root config only). This is a real speed win over
91
+ * `typescript-eslint` but carries two hard requirements the base config
92
+ * deliberately avoids forcing on every consumer:
93
+ *
94
+ * 1. the `oxlint-tsgolint` package must be installed, and
95
+ * 2. TypeScript 7.0+ (tsgolint runs on typescript-go).
96
+ *
97
+ * Without `oxlint-tsgolint` present, oxlint fails at runtime with
98
+ * "Failed to find tsgolint executable" — so this stays opt-in.
99
+ *
100
+ * Usage (root `.oxlintrc.json` is generated from this, or compose in a
101
+ * JS/TS config):
102
+ *
103
+ * // oxlint.config.ts
104
+ * import { withTypeAware } from '@wellmade/oxlint-config';
105
+ * export default withTypeAware();
106
+ *
107
+ * Rule tuning is driven by dogfooding against bedrock-js on TS 7 (the first
108
+ * Wellmade project on the native compiler). The `correctness`/`suspicious`
109
+ * categories pull in the type-aware `typescript/*` rules; we keep the
110
+ * high-signal ones (no-base-to-string, no-misused-spread,
111
+ * require-array-sort-compare, no-unnecessary-type-parameters, …) at their
112
+ * category defaults and switch off the one that's wrong for a carefully
113
+ * typed library:
114
+ *
115
+ * - `typescript/no-unsafe-type-assertion` → **off.** It fires on every
116
+ * `as` cast, but validate-then-assert (`pojo`, `parseEnum`, `readJson`)
117
+ * is a deliberate, correct pattern in this stack — the assertion follows
118
+ * a runtime check. typescript-eslint itself leaves this rule out of its
119
+ * `recommended` set for the same reason. 34 of bedrock's 45 first-run
120
+ * findings were this rule; enforcing it would punish the safe pattern.
121
+ *
122
+ * @param {object} [config] base config to layer onto (defaults to baseConfig)
123
+ * @returns {object} a new config object with type-aware linting enabled
124
+ * @see https://oxc.rs/docs/guide/usage/linter/type-aware.html
125
+ */
126
+ export function withTypeAware(config = baseConfig) {
127
+ return {
128
+ ...config,
129
+ options: {
130
+ ...config.options,
131
+ typeAware: true,
132
+ },
133
+ rules: {
134
+ ...config.rules,
135
+ 'typescript/no-unsafe-type-assertion': 'off',
136
+ },
137
+ };
138
+ }